DEV Community

Discussion on: JavaScript, Ruby and C are not call by reference

Collapse
 
kkkoshumu profile image
Kosumu

At the replaceWithOne function body, did you mean list = [1]?
because if it is [] then I cannot observe the unchanged.

Sorry if I got it wrong I'm super newbie.
Thank you very much for the article!

Collapse
 
sleeplessbyte profile image
Derk-Jan Karrenbeld

No need to apologise for asking!

I've changed the example to be more clear. Does this answer your question?