DEV Community

Discussion on: JavaScript, Ruby and C are not call by reference

Collapse
 
val_baca profile image
Valentin Baca

Same for Java.

The way I phrase it is: Java/JS/Ruby/C/etc are always pass by value; for objects the value is the reference.

Collapse
 
sleeplessbyte profile image
Derk-Jan Karrenbeld

In JS among others, the value is actually always a reference. V8 for example, boxes all primitives as JSValue which is a reference type in C.

That said, for general everyday use, your phrasing is perfectly fine when you're just trying to get stuff done :)