Technically, JS works "pass-by-value" since you pass a copy of a reference. But if you modify that copy of the reference then it modifies the original object so that's basically "pass-by-reference" xd
Same as Primitive Data Types Immutability is basically the same as pass-by-value.
So it depends, you can see the glass half empty or half full
Please take a look
stackoverflow.com/questions/131044...
Thanks, exactly what I said but remember primitives are immutable so that why they act as "pass-by-value"
Oh, let me confirm again. In JS, we only "pass-by-value"
Okay, I got your point.
Technically, JS works "pass-by-value" since you pass a copy of a reference. But if you modify that copy of the reference then it modifies the original object so that's basically "pass-by-reference" xd
Same as Primitive Data Types Immutability is basically the same as pass-by-value.
So it depends, you can see the glass half empty or half full
Agree with you