3 ms·
Okay, I'll bite. What, exactly, do you think should happen if you have an object of the form { task: "do stuff", task: "do other stuff" } ? Objects in JS
by jackmaney 12y ago
Okay, I'll bite.
What, exactly, do you think should happen if you have an object of the form
{ task: "do stuff", task: "do other stuff" }
? Objects in JSON are key-value pairs. A single key goes to a single value. Instead, you should map task to an array of values.
- mjevans 12y agoNo, you should have written an array of values to begin with. Coercing data types is surely more wrong than taking the most recently supplied value for a given key in a map.
- mc808 12y agoUm, I think you're agreeing. "Instead, you [i.e., not the deserializer] should map task to an array of values."