Visit think1s to get more such questions.
Revise Accidental Global Variable concepts to answer this questions.
What is the output the following code?
function getNumber() {
var a = b = 2;
a++;
return a;
}
console.log(typeof a);
console.log(typeof b);
To know the answer click here
What is the output the following code?
function getNumber() {
var a = b = 2;
a++;
return a;
}
getNumber();
console.log(typeof a);
console.log(typeof b);
To know the answer click here
Top comments (1)
You can add syntax highlights as well.
Read here
github.com/adam-p/markdown-here/wi...