Method Parameters in OOP in JavaScript
Methods can take parameters. Let's pass two parameters to our method as an example:
javascriptclass User {
show(name, surn) {
return name + ' ' + surn;
}
}
Let's create an object of our class:
javascriptlet user = new User;
Let's call our method, passing the parameters to it:
javascriptconsole.log(user.show('john', 'smit'));
Задание 1
Pass the employee's name and salary to your test method.