Let’s say I have a conditional statement inside of a function that is set to fire another function with specific values each time it’s run (in this case the value of var changes each time a different portion of the conditional is run:
function runOne() {
if (s=='false') {
runTwo();
} else if (p=='false') {
runTwo();
} else if (d=='false') {
runTwo();
}
}
function runTwo() {
addSomething(k);
}
How do I let the second function know what the new value of k is each time? And how would I set this up in general?
Thanks anyone who can help!
you could pass it as a parameter… like this: