Javascript 如何在另一个函数中调用类函数
这是一个类中的代码Javascript 如何在另一个函数中调用类函数,javascript,visual-studio,Javascript,Visual Studio,这是一个类中的代码 addUser (id,name,email,password,mobile) { // Creating a new instance of User with the details provided let newUser = new User(id,name,email,password,mobile); // Adding the new instance of User into the Accounts array this._
addUser (id,name,email,password,mobile)
{
// Creating a new instance of User with the details provided
let newUser = new User(id,name,email,password,mobile);
// Adding the new instance of User into the Accounts array
this._accounts.push(newUser);
}
我需要调用adduser name如何编写代码,如果我的代码错误,请记下alrady
function(){
let i=0;
adduse(newuser(name))=i;
}
addUser
是类上的方法吗?那么什么是adduse(newuser(name))=i代码>应该做什么??什么是newuser?当用户创建名称时,数据将存储到类中