Skip welcome & menu and move to editor
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>
 
/* jshint esnext: true */
var generateId = function() {
  this.id = this.id ? this.id + 1 : 1;
  
  return this.id;
}
var Person = class {
  constructor(first, last) {
    this.first = first;
    this.last = last;
    this.id = generateId();
  }
  
  toString() {
    return this.id + ' ' + this.first + ' ' + this.last;
  }
};
var Employee = class extends Person {
    isManager() {
      return false;
    }
}
var alice = new Person('Alice', 'Seasons');
console.log(alice.toString());
var developer = new Employee('Kevin', 'Nice');
console.log(developer.toString());
console.log(developer.isManager());
Output

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

Dismiss x
public
Bin info
primaryobjectspro
0viewers