An Interest In:
Web News this Week
- April 19, 2024
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
- April 13, 2024
March 22, 2022 03:21 am GMT
Original Link: https://dev.to/learndaily1/js-interview-question-2-accidental-global-variable-4fjb
JS Interview Question 2 (Accidental Global Variable)
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
Original Link: https://dev.to/learndaily1/js-interview-question-2-accidental-global-variable-4fjb
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To