Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
March 22, 2022 03:21 am GMT

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:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To