Is there any equivalent of ?? operator as exists in C# in JavaScript to defeat 'undefined' checking? For example:
var count = something ?? 0;
Use logical OR
var count = something || 0;
someflag || true will return true if someflag is false
var count = (typeof something === 'undefined') ? 0 : something;This is a more verbose version of @Zee's answer (arguably more secure).