I'm trying to access one parameter from a function and use it in another function but I can't access the parameter outside of its original function. The other function is not able to see the parameter even when I return it.
function GiveBCount(a,b){
a; //do something that has nothing to do with b.
//a is not a number
var b = 0;
b++;//increase b.
//b is a number.
return b;
}
function TakeBCount(){
if ( b > 0){
//do something
}
}
What is expected is that I want to be able to access the result of b that is in the GiveBCount() function inside of the TakeBCount() function