Possible Duplicate:
JavaScript: var functionName = function() {} vs function functionName() {}
I would like to know if there is some hidden difference between the two following constructor function:
var Person = function(name){
this.say=function(){
console.log(name);
}
}
and this one:
function Person(name){
this.say=function(){
console.log(name);
}
}
suppose we are always going to write:
var x = new Person('xxxxx');
x.say();
It appear to be the same in order to me, but I'm really green in javascript and I would like to know if some form is wrong and if there is some best practices to follow.