Answer the question
In order to leave comments, you need to log in
A function that changes the value of a variable?
Here I have a money variable and its value is 0. How to make the function increase it by 1 when it is executed
Answer the question
In order to leave comments, you need to log in
var a = 0;
function func(newA) {
return newA+1;
}
a = func(a);
var a = { a: 1 };
function func(newA) {
newA.a += 1;
}
func(a);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question