I am looking for a way to modify an object that was defined by a literal without passing it into another function.
example:
let o = {a:1,b:2}
console.log(o.a===3)
i thought when i define an object using a literal the the Object constructor would be called, so i did override Object.prototype.constructor
but it only gets called when i do new Object({a:1,b:2})
question in simpler terms can anyone make a=3
without passing the object o to a function or a proxy or using o.a=3
or with
keyword, where o
is defined using an object literal?