You probably should have mentioned that this isn't a part of the official ECMAScript specification. :)
Also, you can usually just use OR operator - || - for this, except if you consider some of the falsy values to actually be values (eg. not null or undefined, as descibed in developer.mozilla.org/en-US/docs/W...).
You probably should have mentioned that this isn't a part of the official ECMAScript specification. :)
Also, you can usually just use OR operator - || - for this, except if you consider some of the falsy values to actually be values (eg. not null or undefined, as descibed in developer.mozilla.org/en-US/docs/W...).
Thanks, Sebastijan. Forgot to include this! Will add :)