About 80,100 results
Open links in new tab
  1. What is the difference between null and undefined in JavaScript?

    Feb 22, 2011 · From the preceding examples, it is clear that undefined and null are two distinct types: undefined is a type itself (undefined) while null is an object. Proof :

  2. What reason is there to use null instead of undefined in JavaScript?

    Oct 2, 2012 · It can be helpful to have predictable types and this can guide thinking to use one or another. Where an object is always returned, needed or wanted by design, use null for falsy …

  3. 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'.

  4. Qual a diferença entre null e undefined? - Stack Overflow em …

    Diferença semântica Como já apontado nas respostas do Calebe Oliveira e do Alexandre Marcondes, existe uma diferença semântica entre null e undefined: o valor null é utilizado …

  5. 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 …

  6. difference between null and undefined in JavaScript?

    Aug 31, 2012 · According to What is the difference between null and undefined in JavaScript?, null and undefined are two different objects (having different types) in Javascript. But when I …

  7. How can I 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 …

  8. ¿Cuál es la diferencia entre 'null' y 'undefined' en JavaScript?

    Jan 7, 2025 · Cuál es la diferencia en JavaScript entre una variable undefined y una variable null? cómo puedo saber si una variable está null, undefined o ambos? también quisiera saber si …

  9. Is it better to return `undefined` or `null` from a javascript function?

    Jun 23, 2016 · The reason I'm asking this question is that I heard somewhere something that sounded like "Don't assign undefined to variables" or something - that it will make it harder to …

  10. What is the difference between Null, NaN and undefined in …

    May 14, 2018 · What is the difference between Null, NaN and undefined in JavaScript? I have come across all three values, and have understood them to be “there isn’t anything here” in …