For any C programmers, think of the difference between char** and char*.
foo(char *a){a="hello";}
does nothing, but if you do
foo(char *a){a[0]='h';a[1]='i';a[2]=0;}
it is changed outside because
a
is a memory location passed by value that references a string. Passing structs (similar to js objects) by value in C is allowed, but not recommended. JavaScript simply enforces these best practices and hides the unnecessary and usually undesired cruft... and it sure makes for easier reading. —
technosaurus 18 secs ago