JS: Reflect.isExtensible
(new in ECMAScript 2015)
Reflect.isExtensible(obj)-
Return
trueif obj is extensible. Else,false.If obj is not object, throw a TypeError exception.
🟢 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) === true); Reflect.preventExtensions(jj); console.assert(Reflect.isExtensible(jj) === false);