JavaScript Symbol.unscopables Properties

The Java Symbol.unscopables symbol is an object value whose inherited property names are excluded from with environment bindings.

NOTE:

  1. Setting a property to true in an unscopables object makes it unscopable and therefore it won't appear in lexical scope variables.
  2. Setting a property to false makes it scopable and thus it will appear in lexical scope variables.

Syntax

Parameters

Object.

Return value

Check the variable appear in lexical scope variable.

Browser Support

Chrome32
Safari8
Firefox29
Opera19

Example 1

Test it Now

Output:

1

Example 2

Test it Now

Output:

JavaTpoint





Latest Courses