In the following code snippet, what are the local variables of the function modByTwo?

function addFive(x){
var five = 5;
var result = x + five;
return result
}

function modByTwo(x){
var result = x % 2;
return result;
}


result and x


x only


five, result and x


result only

Answer :

Result is the local variable because it can only be accessed and determined by the main functions which are addFive and modByTwo. A local variable is a variable that can only be accessed by its scope. Remember to like if this helped

Other Questions