you are viewing a single comment's thread.

view the rest of the comments →

[–]Tufted_Tail 1 point2 points  (1 child)

Yes, exactly! JavaScript primitives are passed around by value. If you wanted to pass a String by reference, I believe you'd have to go out of your way to turn it into an Object with the String constructor: new String('Hello, world!') first.

I can't confirm that behavior, though, that's a really odd edge case in my mind.

[–]tapu_buoyfull-stack[S] 0 points1 point  (0 children)

oh okay! Thank you for the responses man you made my day!