0

I was reading the exemple : (for Sequelize, a NodeJS ORM) :

var User = sequelize.define("User", {
  username: DataTypes.STRING
  }, {
    classMethods: {
      associate: function(models) {
        User.hasMany(models.Task) // HERE !!! <-----
      }
    }
});

In the associate method, I call a function of User. The code seems to work but I wonder how is it possible that User is defined as...it's not yet defined...

IggY
  • 3,005
  • 4
  • 29
  • 54

0 Answers0