Query.toObject() expects as first argument the prototype for the newly-created object. I'm pretty proficient in JavaScript, but prototypes have never become second nature to me.
Usually, what I want is just a plain object, as if I had created it via { ... }. It would be great if the documentation gave an example of this most likely case. That way, I wouldn't have to wonder each time: Do I pass Object? Object.prototype? {}? null? (No, probably not null.)
Query.toObject()
expects as first argument the prototype for the newly-created object. I'm pretty proficient in JavaScript, but prototypes have never become second nature to me.Usually, what I want is just a plain object, as if I had created it via
{ ... }
. It would be great if the documentation gave an example of this most likely case. That way, I wouldn't have to wonder each time: Do I passObject
?Object.prototype
?{}
?null
? (No, probably notnull
.)