I'm trying to understand why this code behaves the way it does:
test.js
var User;
console.dir(User);
function User(name) { // User = function(name) { ... seems not to be the same?
this.name = name;
}
node test.js
[Function: User]
Why does User
have a value before the function()
statement?