Other than creating a function, is there a shorter way to check if a value is undefined,null or false only in JavaScript?
undefined
null
false
One way to do it is like that:
var acceptable = {"undefined": 1, "boolean": 1, "object": 1}; if(!val && acceptable[typeof val]){ // ... }
I think it minimizes the number of operations given your restrictions making the check fast.