DEV Community

loading...

Discussion on: Master value vs reference in JavaScript

Collapse
dobesv profile image
Dobes Vandermeer

Primitives really might be assigned by reference, especially strings. Maybe you have confused JavaScript and Java semantics? JavaScript doesn't really have this primitive value concept in its design even if the underlying compiler might have some optimizations that pass numbers by calling rather than reference.

Collapse
arnavaggarwal profile image
arnav-aggarwal Author

I know I'm not using correct terminology, but I think the way I've explained it is easiest for someone who has very little programming knowledge to understand. Although it's technically not correct it explains the behavior of JavaScript with a simple model.

Collapse
arnavaggarwal profile image
arnav-aggarwal Author

This article is aimed towards beginners looking for their first job. I didn't want to get technically deep. This was meant to encourage people to look into these concepts further.