I'm just trying to get my head around this function expression.
It seems that if I create a function expression (p
) that seems to contain a function declaration, the function declaration a()
returns undefined.
var p;
p = function a() { return 'Hello' }
typeof p; // returns 'function'
typeof a; // returns 'undefined'
Can anyone explain why this is the case?
And also please let me know if my terminology is off too.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…