Is it possible to have multiple parameters for Object.defineProperty setter function?
Yes, but it's not possible to invoke them (other than Object.getOwnPropertyDescriptor(obj, "joe").set(null, false)
). A setter is invoked with the one value that is assigned to the property (obj.joe = "doe";
) - you cannot assign multiple values at once.
If you really need them (for whatever reasons), better use a basic setter method (obj.setJoe(null, false)
).