Arrays and functions
Fri Oct 01 2021 12:09:11 GMT+0000 (UTC)
Saved by @ianvalentino #javascript
So when you pass an array into a function, if the array is mutated inside the function, that change will be maintained outside the function as well. You might also see this concept explained as pass-by-reference since what we’re actually passing the function is a reference to where the variable memory is stored and changing the memory.
https://www.codecademy.com/courses/introduction-to-javascript/lessons/arrays/exercises/array-in-functions
Comments