@Jasper: because tuples can be insanely optimized - their immutability
(including fixed length) removes almost any overhead (JS objects
overhead is quite big). Of course, modern engines can optimize array
to be
@Jeremy: consistency with other immutable primitives and frozen objects.
`(function() {
'wow'[0]='a';
})() // undefined, silently fails
(function() {
'use strict';
'wow'[0]='a';
})(); //TypeError: 0 is read-only
(function() {
'use strict';
Object.freeze({'oh': 'hai'})).oh = 'Cthulhu';
})(); // TypeError: "oh" is read-only
(function() {
Object.freeze({'oh': 'hai'})).oh = 'Cthulhu';
})(); // undefined, silently fails
`
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss