Is there any difference between var name = function() {} & function name() {} in Javascript?
- by Fletcher Moore
Suppose we are inside a function and not in the global namespace.
function someGlobalFunction() {
var utilFunction1 = function() {
}
function utilFunction2 () {
}
utilFunction1();
utilFunction2();
}
Are these synonymous? And do these functions completely cease to exist when someGlobalFunction returns? Should I prefer one or the other for readability or some other reason?