My Rank class includes attributes for "loses" and "wins" obtained from a web service. I need to calculate the "points" attribute based on these values.
For example:
for(int i = 0; i<loses; i++{
points += 1;
}
for(int i = 0; i<wins; i++{
points += 2;
}
Rank Class
class Rank{
$id?:number;
loses?:number;
team?:string;
wins?:number;
points: number;
constructor(){}
}
Where should I implement this logic?