Wednesday, 16 July 2014

Functional JavaScript if statement?

Does JavaScript have if statement with return value like Scala?
No, it doesn't.

You have to write a ternary:
var result = checkingValue == null ? "" : checkingValue;
or use function.

No comments:

Post a Comment