I must confess, JavaScript has -sometimes- strange behaviors.
var Npc = function() {
this.name='Hello world';
}
Npc.attr='my new attribute';
console.log('>>>>'+Npc.attr); // my new attribute
console.log('>>>>'+Npc.name); // '' ????
var data = new Npc();
console.log('>>>>>' + data.attr); // undefined
console.log('>>>>>' + data.name); // Hello world
Sounds weird to me. If I can understand the .name difference (instance vs literal), I cannot understand the "attr" behavior.
Is it a COW ? But with the node.js debugger I really see the attr atribute !?
Waw...