JSFiddle - React, Tailwind, and code Playground
JavaScript
function abc(){
var a = b = 10; // a is local, b is global variable. Right?
c = 5; // c is global variable
}
d = 20; // d is global variable
// console.log(a); // a is not defined. Makes sense.
console.log(b); // b is not defined error. Why? Isn't b a global variable?
console.log(c); // Again, Why is 'c not defined'.
// console.log(d); // 20. This works fine. Expected.