There is this answer on Stack Overflow to support that JS function declarations hoist before variable declarations. It\'s based on very earlier version of Spec.
Link to t
I think the debate of hoisting order of function dec vs variable dec is not much relevant. Function decs are fully present in memory during creation phase. Only when a var declaration with same name as function is assigned a value , the function declaration is no more valid. But if there is just a var declaration with same name as function, it is ineffective. (This was actually a part of earlier spec) As per modern spec, it seems the order doesn’t matter since the declarations never actually move up. It’s actually those being in memory before execution phase. That’s why var coming before function or function coming before var declaration wouldn’t make a difference.