4 ms·
It throws an error in strict mode. "use strict"; var square = {length:10}; Object.freeze(square); square.length = 20; C:\Users\Matt\Code\
by quarterto 14y ago
It throws an error in strict mode.
"use strict";
var square = {length:10};
Object.freeze(square);
square.length = 20;
C:\Users\Matt\Code\seal.js:5
square.length = 20;
^
TypeError: Cannot assign to read only property 'length' of #<Object>
at Object.<anonymous> (C:\Users\Matt\Code\seal.js:5:15)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)