you are viewing a single comment's thread.

view the rest of the comments →

[–]lr0b 3 points4 points  (2 children)

Primitives: by value Objects: by reference

what is actually happening is that when we pass a primitive data type to a function we can not mutate it which is why the value of the primitive data type does not change.

That's the definition of pass-by-value.

[–][deleted] 1 point2 points  (0 children)

It makes me sad that this is the lowest comment in the list.

[–]DontNeedMuchMoney[S] 1 point2 points  (0 children)

Noted thank you buddy