offline version v3


16 of 264 menu

Object construct

The Object construct creates an object containing keys and their corresponding values.

Syntax

let object = new Object(object elements separated by commas);
let object = {object elements separated by commas}

Example

Let's create a new object:

let object = new Object({'a': 1, 'b': 2, 'c': 3}); console.log(object);

The code execution result:

{'a': 1, 'b': 2, 'c': 3}

See also

  • the Array construct
    that creates a new array
enru