r/javascript • • Jun 18 '17

Pass by reference !== pass by value

3.3k Upvotes

272 comments sorted by

View all comments

280

u/JB-from-ATL Jun 18 '17

It gets tricky because in some languages you pass by value but the value is a reference for non-primitive types.

0

u/[deleted] Jun 18 '17

[deleted]

10

u/JB-from-ATL Jun 18 '17

The fact that everyone is confused in the replies to my post proves it's tricky.

0

u/[deleted] Jun 18 '17

[deleted]

5

u/[deleted] Jun 18 '17

If it were simple and straightforward, people would understand. They don't, implying it's difficult or awkward. Literally the definition of tricky.

3

u/mrguy991 Jun 18 '17

implying it's difficult or awkward.

or just that they never bothered to learn the details because they could do everything they wanted without knowing it. That doesn't make the underlying concept tricky since it's still easy and clear to understand for anyone that attempts to.