4 ms·
There are other solutions: http://brandon.pulpexplosion.com/index.php/2010/05/javascript-pointers/ http://brandon.pulpexplosion.com/index.php/2010/05/javascrip.
by gildas 15y ago
There are other solutions:
http://brandon.pulpexplosion.com/index.php/2010/05/javascript-pointers/ http://brandon.pulpexplosion.com/index.php/2010/05/javascrip...
- boucher 15y agoIt's not exactly fair to call either technique pointers, but the original could be useful for more things than just this (though this is probably the intended use case). The linked article, however, makes no sense. The author does not seem to understand how JavaScript works. Arrays are not copied when passed to another function.
- anc2020 15y agoThis article is incorrect, arrays are passed by reference since they are objects. I've added a comment on the blog.
- KirinDave 15y agoWhat problem does this solve? What problem do either of these ideas solve? Is the question, "What is the best way to troll programmers on the internet?"
- gildas 15y agoI wish it was the case...