February 2018
Intermediate to advanced
298 pages
8h 22m
English
The Reflect.preventExtensions() is used to mark an object as non-extensible. It returns a Boolean, indicating whether the operation was successful or not.
It's the same as the Object.preventExtensions() method:
var obj = { name: "Eden" };console.log(Reflect.isExtensible(obj)); //Output "true" console.log(Reflect.preventExtensions(obj)); //Output "true" console.log(Reflect.isExtensible(obj)); //Output "false"
Read now
Unlock full access