<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Plunker</title>
</head>
<body>
	<script>
    // Allows Plunker to display logs in preview panel 
    // for better in-browser experience
    var originalConsoleLog = console.log
    console.log = function() {
      originalConsoleLog.apply(console, arguments)
      var args = Array.prototype.slice.call(arguments).map(JSON.stringify);
      document.body.innerText += args.join(' ') + '\n';
      document.body.style['fontFamily'] = 'monospace';
      document.body.style['fontSize'] = '1.5em';
    };
  </script>
  <script src="script.js"></script>
</body>
</html>
// Part 1
class Person {
  constructor(firstName, lastName) {
      this.firstName = firstName;
      this.lastName = lastName;
  }

  sayHi() {
      console.log(`Hi, my name is ${this.firstName}!`);
  }
}

const person = new Person("John", "Doe");
person.sayHi();

// Part 2
// class Person {
//   sayHi = () => {
//       console.log(`Hi, my name is ${this.firstName}!`);
//   };

//   constructor(firstName, lastName) {
//       this.firstName = firstName;
//       this.lastName = lastName;
//   }
// }

// const person = new Person("John", "Doe");
// const greet = person.sayHi;
// greet();