JavaScript isset() equivalent

I generally use the typeof operator: It will return “undefined” either if the property doesn’t exist or its value is undefined. (See also: Difference between undefined and not being defined.) There are other ways to figure out if a property exists on an object, like the hasOwnProperty method: And the in operator: The difference between … Read more

In where shall I use isset() and !empty()

isset vs. !empty FTA: “isset() checks if a variable has a value including (False, 0 or empty string), but not NULL. Returns TRUE if var exists; FALSE otherwise. On the other hand the empty() function checks if the variable has an empty value empty string, 0, NULL or False. Returns FALSE if var has a … Read more