Totally newbie question. So I have an array and I pass it to a function. If the function changes the array in anyway, after the function returns, the array is actually changed.
When I do the same with lets say with an integer parameter, the parameter value before and after the call is the same.
Here is an example.
function test2(inputValue) {
inputValue += 5;
}
function test1() {
var input = 1;
input = test2(input);
console.log('input: ' + input);
}
test1();
input : 1 so the value of the parameter was unchanged.
not sure how to explain that.
Thoughts?