I've seen code on the web like this (simplified):
var abc = {};
Object.defineProperty(abc, 'example', {
enumerable: 0,
configurable: 1,
writable: 1,
value: function() {}
});
where in place of true
and false
they use 1
and 0
. I prefer this method for its simplicity, but I need to know:
Is this defining format nonstandard and inconsistent across browsers and should be avoided, or is it safe to use in production-level code?