3 ms·
yes, essentially that is the same as my changeprop function so I do understand that - however what the parent comment was arguing about was the actual terminolo
by bryanrasmussen 7y ago
yes, essentially that is the same as my changeprop function so I do understand that - however what the parent comment was arguing about was the actual terminology and wondering why no one ever uses it correctly.
As I noted in another comment I don't think people use the terminology correctly because explaining to people the difference makes explaining an already complicated thing more complicated, and also it makes communication less elegant if more precise. I certainly never say Objects are passed by value of a reference, I just say they are passed by reference and if someone wants to take the time to correct me I would probably say "yes, sorry I was imprecise"
- gbuk2013 7y agoOK, after a bit more reading I now understand the difference, thank you for your patience. But it remains true that in Javascript you can not pass an object by value, because the language does not permit creating copies of objects. You can only ever pass a reference to an object (which is indeed only ever done by value) so the usefulness of arguing about the distinction is questionable at best.