Questions about Javascript documentation

Questions about Javascript documentation
0.0 0


At this page

The first table:
Property attributes of Array.prototype
Writable no
Enumerable no
Configurable no
What’s mean: the true value at no?


If I understand your question, you want to know what Writable, Enumerable, and Configurable mean.


true if and only if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object.
Defaults to false.

true if and only if this property shows up during enumeration of the properties on the corresponding object.
Defaults to false.

true if and only if the value associated with the property may be changed with an assignment operator.
Defaults to false.

So the documentation you cited is saying that Array.prototype is not:


console.log(Array.prototype) // [] Array.prototype = 'something' console.log(Array.prototype) // [] // notice we didn't change the value of Array.prototype; it isn't writable


// enumerating properties of Array for (var property in Array) { console.log(property) } // nothing will be printed, indicating that Array doesn't have any enumerable properties


console.log(Array.prototype) // [] delete(Array.prototype) // false console.log(Array.prototype) // [] // we couldn't delete it; it's not configurable