##JavaScript passes primitive types by value and object types by reference
Now, people like to bicker endlessly about whether "pass by reference" is the correct way to describe what Java et al. actually do. The point is this:
- Passing an object does not copy the object.
- An object passed to a function can have its members modified by the function.
- A primitive value passed to a function cannot be modified by the function. A copy is made.
In my book that's called passing by reference.
— Brian Bi - Which programming languages are pass by reference?
#Update
Here is a rebuttal to this:
##JavaScript passes primitive types by value and object types by reference
Now, people like to bicker endlessly about whether "pass by reference" is the correct way to describe what Java et al. actually do. The point is this:
- Passing an object does not copy the object.
- An object passed to a function can have its members modified by the function.
- A primitive value passed to a function cannot be modified by the function. A copy is made.
In my book that's called passing by reference.
— Brian Bi - Which programming languages are pass by reference?
#Update
Here is a rebuttal to this:
##JavaScript passes primitive types by value and object types by reference
Now, people like to bicker endlessly about whether "pass by reference" is the correct way to describe what Java et al. actually do. The point is this:
- Passing an object does not copy the object.
- An object passed to a function can have its members modified by the function.
- A primitive value passed to a function cannot be modified by the function. A copy is made.
In my book that's called passing by reference.
— Brian Bi - Which programming languages are pass by reference?
#Update
Here is a rebuttal to this:
##JavaScript passes primitive types by value and object types by reference
Now, people like to bicker endlessly about whether "pass by reference" is the correct way to describe what Java et al. actually do. The point is this:
- Passing an object does not copy the object.
- An object passed to a function can have its members modified by the function.
- A primitive value passed to a function cannot be modified by the function. A copy is made.
In my book that's called passing by reference.
— Brian Bi - Which programming languages are pass by reference?
#Update
Here is a rebuttal to this:
##JavaScript passes primitive types by value and object types by reference
Now, people like to bicker endlessly about whether "pass by reference" is the correct way to describe what Java et al. actually do. The point is this:
- Passing an object does not copy the object.
- An object passed to a function can have its members modified by the function.
- A primitive value passed to a function cannot be modified by the function. A copy is made.
In my book that's called passing by reference.
— Brian Bi - Which programming languages are pass by reference?
##JavaScript passes primitive types by value and object types by reference
Now, people like to bicker endlessly about whether "pass by reference" is the correct way to describe what Java et al. actually do. The point is this:
- Passing an object does not copy the object.
- An object passed to a function can have its members modified by the function.
- A primitive value passed to a function cannot be modified by the function. A copy is made.
In my book that's called passing by reference.
— Brian Bi - Which programming languages are pass by reference?
#Update
Here is a rebuttal to this:
##JavaScript passes primitive types by value and object types by reference
Now, people like to bicker endlessly about whether "pass by reference" is the correct way to describe what Java et al. actually do. The point is this:
- Passing an object does not copy the object.
- An object passed to a function can have its members modified by the function.
- A primitive value passed to a function cannot be modified by the function. A copy is made.
In my book that's called passing by reference.
— — BrianBrian Bi - Which programming languages are pass by reference?
##JavaScript passes primitive types by value and object types by reference
Now, people like to bicker endlessly about whether "pass by reference" is the correct way to describe what Java et al. actually do. The point is this:
- Passing an object does not copy the object.
- An object passed to a function can have its members modified by the function.
- A primitive value passed to a function cannot be modified by the function. A copy is made.
In my book that's called passing by reference.
— Brian Bi - Which programming languages are pass by reference?
##JavaScript passes primitive types by value and object types by reference
Now, people like to bicker endlessly about whether "pass by reference" is the correct way to describe what Java et al. actually do. The point is this:
- Passing an object does not copy the object.
- An object passed to a function can have its members modified by the function.
- A primitive value passed to a function cannot be modified by the function. A copy is made.
In my book that's called passing by reference.
— Brian Bi - Which programming languages are pass by reference?