Open finalchild opened 5 months ago
I understand that this repository is mostly stale and stable, but are there any active maintainer who can help resolve this issue? Once the way we handle this is decided, I can work on a PR.
Thank you for provide me this kind of information it is very helpful for me. krogerfeeback.com
There is no such thing called "value type" or "reference type" in JavaScript. The distinction doesn't exist, not in the spec nor in the implementation. The distinction is a common myth, but factually wrong. JavaScript is not Java.
One does not simply pass strings by value. Strings are not a "non-reference type". Strings are "primitive" in the sense that they don't constitute of properties. This has nothing to do with value and reference.
TL;DR: Almost all types of values in JavaScript are stored as references, and passed by sharing. The small set of exceptions are implementation-specific.
For reference, a nice answer written by jmrk: https://stackoverflow.com/questions/74004695/how-v8-handle-stack-allocated-variable-in-closure
primitive values & object values
storing values
passing parameters
comparing values
Object.is
)I suggest that we change the question to something sensible and remove most existing articles. What should the new question be about? Busting this common myth?