re: Javascript uses call by sharing for objects VIEW POST


You say here that:

It is commonly stated that javascript uses pass by value for objects too and that the value for objects is actually the reference of that object. That's what I thought about javascript's evaluation strategy, too. But that statement is not 100% correct either

Isn't that what call by sharing is? I found this SO answer that says the same thing


Yes, that is what call by sharing is 👍 When I google "is javascript pass by value" I see results which says "javascript is pass by value". Only a few of them mentions the term call by sharing. So I'm just interested in the terminology here.


Yeah I had forgotten what call by sharing was until I read your post. I'd gotten used to calling it "call by reference"! I think Python uses the same model if I'm not wrong. Anyway, welcome to DEV!

Thanks! 😄

Code of Conduct Report abuse