MCQs>IT & Programming>JavaScript>What's visible in the console after running code: var a = 'Bolt' function f() { if (!a) { var a = 'Nut' } console.log(a); } f(); console.log(a);
JavaScript MCQs
What will we see in the console after the following code run: var a = 'Bolt'; function f() { if (!a) { var a = 'Nut'; } console.log(a); } f(); console.log(a);
Answer
Correct Answer: 'Nut' then 'Bolt'
Explanation:
Note: This Question is unanswered, help us to find answer for this one