My usual approach is this:
myVar = "myString is" + 1 === 1 ? " really true" : " false, I think";
But sometimes I just need the true part, like so:
myVar = "myString is" + 1 === 1 ? " really true" : "";
The empty string : ""
bothers me because it feels unnecessary.
Is there a way to achieve something similar to the following?
myVar = "myString is" + 1 === 1 && " really true";
While this alternative works, the issue arises when it's false as it then outputs "false"
!