News for hackers. Stuff that matters.
Re:Deep-copying in JavaScript by geoelectric on Thursday January 25, 2018 @04:21PM (#16234782)
The key feature of pass-by-reference is whether the callee can replace the value bound to the caller's argument (not mutate it).

In other words, pseudocoded:

    x=1
    changeMe(x)
    write(x) // 2
With that in mind, it's clearer that JS is pass-by-value with object reference values (or pass-by-sharing, though I never hear that in practice) as the caller remains bound to the passed object, but a C++ reference argument is an actual pass-by-reference of the original binding. So's an argument passed to a Pascal/Delphi out or variable parameter, and I'm sure other examples exist as well.

So I guess it depends on what you mean by "nowadays" but I'd still consider C++ a modern language within "everything".

Re:Deep-copying in JavaScript by quicknir on Friday January 26, 2018 @11:50AM (#16240638)
You can never actually replace what the reference is bound to in C++, you can only call the assignment operator. The real distinction here is that in languages like Java and python, assignment is fundamentally different from mutation. In C++ there is no distinction, assignment is just a form of mutation.