I would like to know if JavaScript has "short-circuit" evaluation like &&
-operator in C#. If not, I would like to know if there is a workaround that makes sense to adopt.
Yes, JavaScript has "short-circuit" evaluation.
if (true || foo.foo){
// Passes, no errors because foo isn't defined.
}
if (false && foo.foo){
// Also passes, no errors because foo isn't defined.
}