Lovish Duggallovishduggal.hashnode.dev·Jul 8, 2023How do functions work in JavaScript & Variable Environment?Guess what is the output of the program? 1 var x = 10; 2 a(); 3 b(); 4 console.log(x); 5 function a() { 6 var x = 100; 7 console.log(x); 8 } 9 function b() { 10 var x = 1000; 11 console.log(x); 12 } Output is: 100 1000 10 Why do we ...2 likes·66 readscore-concepts of javascriptJavaScriptAdd a thoughtful commentNo comments yetBe the first to start the conversation.