mercredi 18 février 2015

Node.js: Referencing custom class within another custom class


I'm writing a web backend that has a User class. It also has an Attributes class which records user stats. However, I'm unsure how to reference the Attributes class within the User.js file. I'd want to be able to do this, more or less:



function User(id){
this.attributes = new Attributes();
}

module.exports = User;




Aucun commentaire:

Enregistrer un commentaire