bhylu.com

Advertisements

JS Keywords

Keywords have language meanings and cannot always be used as binding names. Object property names follow different rules.

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 booking = {default: "morning"};
console.log(booking.default);

What happens

The keyword-shaped property name is valid in this object.