Sometimes it happens that there are 50k + lines in the code and they should be optimized to make it work faster. Here I have such a question about functions. We know difference between:
function f () {
//code here
}
and
var f = function () {
//code here
}
first is instant declared when code loads and second is declared in the process of going through the code. It means that:
f();
var f = function () {
//code here
}
this will throw an error. However:
f();
function f () {
//code here
}
this will work fine.
My question is this. Is there any fundamental difference between those two declarations. Can it affect the performance of such big projects where code lines are above 50k?