JS: Reflect.isExtensible
(new in ECMAScript 2015)
Reflect.isExtensible(obj)-
Return
trueif obj is extensible. Else,false.If arg is not an object, throw TypeError.
🟢 tip: this is a better version of Object.isExtensible because it throw error if arg is not object.
const jj = {}; console.assert(Reflect.isExtensible(jj)); Reflect.preventExtensions(jj); console.assert(Reflect.isExtensible(jj) === false);