al_Objects/Object#null-prototype_objects)
with property names given below and their values set to ` true ` .

Property attributes of ` Array.prototype[@@unscopables] `  
---  
Writable  |  no   
Enumerable  |  no   
Configurable  |  yes   
  
##  Description

The default ` Array ` properties that are ignored for ` with ` statement-
binding purposes are:

  * [ ` at() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at)
  * [ ` copyWithin() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)
  * [ ` entries() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries)
  * [ ` fill() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)
  * [ ` find() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
  * [ ` findIndex() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex)
  * [ ` findLast() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast)
  * [ ` findLastIndex() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex)
  * [ ` flat() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat)
  * [ ` flatMap() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap)
  * [ ` includes() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)
  * [ ` keys() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/keys)
  * [ ` toReversed() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed)
  * [ ` toSorted() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted)
  * [ ` toSpliced() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced)
  * [ ` values() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values)

` Array.prototype[@@unscopables] ` is an empty object only containing all the
above property names with the value ` true ` . Its [ prototype is ` null `
](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object#null-
prototype_objects) , so ` Object.prototype ` properties like [ ` toString `
](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString) won't
accidentally be made unscopable, and a ` toString() ` within the ` with `
statement will continue to be called on the array.

See [ ` Symbol.unscopables ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/unscopables) for how to
set unscopable properties for your own objects.

##  Examples

Imagine the ` keys.push('something') ` call below is in code that was written
prior to ECMAScript 2015.

js

    
    
    var keys = [];
    
    with (Array.prototype) {
      keys.push("something");
    }
    

When ECMAScript 2015 introduced the [ ` Array.prototype.keys() ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Array/keys) method, if the `
@@unscopables ` data property had not also been introduced, that `
keys.push('something') ` call would break â because the JavaScript runtime
would have interpreted ` keys ` as being the [ ` Array.prototype.keys() `
](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/keys) method,
rather than the ` keys ` array defined in the example code.

So the ` @@unscopables ` data property for ` Array.prototype ` causes the `
Array ` properties introduced in ECMAScript 2015 to be ignored for ` with `
statement-binding purposes â allowing code that was written prior to
ECMAScript 2015 to continue working as expected, rather than breaking.

##  Specifications

Specification  
---  
[ ECMAScript Language Specification  
#  sec-array.prototype-@@unscopables
](https://tc39.es/ecma262/multipage/indexed-collections.html#sec-
array.prototype-@@unscopables)  
  
##  Browser compatibility

BCD tables only load in the browser  with JavaScript enabled. Enable
JavaScript to view data.

##  See also

  * [ Polyfill of ` Array.prototype[@@unscopables] ` in ` core-js ` ](https://github.com/zloirock/core-js#ecmascript-array)
  * [ Indexed collections ](/en-US/docs/Web/JavaS