Answer the question
In order to leave comments, you need to log in
How to add to array?
In general, how to do so, to add to the array? I keep getting an error.
class Live {
constructor()
{
this.users = [];
}
add(user)
{
if(typeof user.play !== 'undefined')
{
this.users.push({
username : user.username,
play : user.play,
});
}
}
get()
{
return this.users;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question