Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
/*
*  In the Employee constructor, prepend the `name` and `salary` properties with an underscore (`_`).
* Add a getter method called `name()` that returns the value of the `name` property
* Add a getter method called `salary()` that returns the value of the `salary` property
* Add a setter method called `name(newName)` that allows you to provide an employee with a new name
*/
class Employee {
  constructor(name, salary) {
    this.name = name
    this.salary = salary
  }
  
  // add code below
  // add code above
}
/*
  Uncomment lines below after you've made your updates
*/
// const methodMan = new Employee("Johnny Blaze", "100000")
// console.log(methodMan.name)
// console.log(methodMan.salary)
// methodMan.name = "Jonathan Blaze"
// console.log(methodName.name)
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x