What\'s the best way of checking if an object property in JavaScript is undefined?
function isUnset(inp) { return (typeof inp === 'undefined') }
Returns false if variable is set, and true if is undefined.
Then use:
if (isUnset(var)) { // initialize variable here }