About 11,200 results
Open links in new tab
  1. What is the difference in JavaScript between 'undefined' and 'not ...

    May 7, 2009 · Yes, variables can have a value of undefined and you can explicitly assign values to them. Assigning undefined to a variable though is probably confusing, since it's a bit of a …

  2. How can I check for "undefined" in JavaScript? - Stack Overflow

    – Daniel Schaffer Aug 2, 2010 at 18:09 3 See: How to check for undefined in javascript?, and whether a variable is undefined and How to handle ‘undefined’ in javascript – Shog9 Aug 3, …

  3. Javascript undefined condition - Stack Overflow

    Aug 29, 2011 · undefined is a variable, not a constant, and can be assigned a value. Because of this, one school of thought says the second path is safer, since you cannot be sure of the …

  4. How to check for an undefined or null variable in JavaScript?

    While literally using the keyword undefined, Boolean(undefined) works, trying that with an undefined variable doesn't work, and that is the whole point of doing the check for null or …

  5. What is the difference between null and undefined in JavaScript?

    Feb 22, 2011 · The difference between null and undefined is: JavaScript will never set anything to null, that's usually what we do. While we can set variables to undefined, we prefer null …

  6. JavaScript checking for null vs. undefined and difference between ...

    Feb 24, 2011 · How do I check a variable if it's null or undefined and what is the difference between the null and undefined? What is the difference between == and === (it's hard to …

  7. The difference between `typeof x !== "undefined"` and `x != null`

    I can't find any difference between typeof somevar == 'undefined' and typeof somevar === 'undefined', because typeof always returns string. For null it will return 'object'. Or could be that …

  8. javascript - What does [object Object] mean? - Stack Overflow

    string, number, boolean, null, undefined, and symbol. In JavaScript there are 7 primitive types: undefined, null, boolean, string, number, bigint and symbol. Everything else is an object. The …

  9. javascript - How to compare variables to undefined, if I don’t know ...

    May 6, 2010 · In JavaScript you can declare a variable and if it’s undefined, you can check variable == undefined; I know that, but how can you compare a value that you don’t know yet if …

  10. How to handle 'undefined' in JavaScript - Stack Overflow

    Dec 31, 2009 · typeof foo !== 'undefined' window.foo !== undefined 'foo' in window The first two should be equivalent (as long as foo isn't shadowed by a local variable), whereas the last one …