[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Operators/null [Back]  [Original]

null - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

null

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 ..

null - . JavaScript, null , , (falsy).

In this article

function getVowels(str) {
  const m = str.match(/[aeiou]/gi);
  if (m === null) {
    return 0;
  }
  return m.length;
}

console.log(getVowels("sky"));
// Expected output: 0

null

null null. , ( undefined). API, null , .

js
//  foo   -        :
> foo
'ReferenceError: foo is not defined'

//  foo ,      ,  :
> var foo = null; foo
'null'

null undefined

null , undefined . :

js
var element;
//   element     : undefined

element = document.getElementById("not-exists");
//      ,  getElementById  null
//  element    null,   

null undefined, (==) (===): , .

js
typeof null; // object ( "null"    )
typeof undefined; // undefined
null === undefined; // false
null == undefined; // true

Specification
ECMAScript 2027 LanguageSpecification
# sec-null-value


Web Proxy Viewer  |  New URL  |  Original Page