首页 > 解决方案 > 如何在另一个函数中调用 Classes 函数

问题描述

这是类中的代码

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;
}

标签: javascriptvisual-studio

解决方案


推荐阅读