Which is the better way for conditional variable assignment?
1st method
if (true) {
var myVariable = \'True\';
} else {
var myVariable = \'False\
It depends on the use for me. If I have code that I only want to run if true, but with no extra code for false, I'll use the second. If I want to execute some code on true, and different on false, I use the first. It all depends on use, but the general rule for me is to write once. Keep it clean, keep it simple, and keep it short