bhylu.com

Advertisements

JS undefined

Undefined often means a value was not supplied or a property was not found. Distinguish that from a deliberate null value.

Where to run this

This example uses the JavaScript console playground. Select Run to execute it; the example does not run on this lesson page.

A practical example

JavaScript

const session = {title: "Repair club"};
console.log(session.price === undefined);

What happens

The missing price property reads as undefined.