Javascript - Undefined

> (World Wide) Web - (W3|WWW) > Javascript (Js|ECMAScript) > ECMAScript - Grammar Standard

1 - About

When the value of variable or property is not defined, it gets the type undefined.

It's handy to see if a variable is passed as an argument of a function.

Are undefined:

  • a not declared variable
  • a declared variable without value
  • functions that return no values
  • the void operator.
Advertising

3 - Example

if (typeof sec === 'undefined') console.log("The variable sec is not defined");

4 - Documentation / Reference

web/javascript/es/undefined.txt · Last modified: 2019/02/16 17:40 by gerardnico