I called helloworld and defined it with below two different ways:
1) With variable
2) With function name itseld
var helloWorld = function() {
return '2';
}
function helloWorld() {
return '1';
}
alert (helloWorld()); // This alert 2, but in absence of "var helloWorld = ....", it alert "1".
Can anyone please explain reason why it's calling var helloWord = ? and not function helloWorld () ?
Thank You !!