Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The advantage is in mutating arrays. You don't need to send the entire array back, just the commands for which index gets added/ removed / replaced.

Also, there's no way to differentiate between deleting a key from an object and leaving it unchanged if you send a partial patch, assuming that `null` is a distinct value different than actually deleting the key itself.



To your second point, the JSON spec allows `null` but not `undefined`, so most js serializers (all?) don't send (or throw an exception) for any `undefined` from any object you attempt to send. To delete a property, you would send the entire surrounding object. Or you can simply define your data-layer without transient key/values. It's certainly not a necessary feature to have.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: