'use strict';
function NAME2 (){
name = 'Smith';
console.log(name);
}
NAME2();
function NAME3 (){
name = 'John';
console.log(name);
}
NAME3();
As you can see in both the functions, I havent used any variable keyword to define the variable thats somehow still executing.
What's wrong?
Or is it simply optional to use variable keyword in JS?