JSFiddle - React, Tailwind, and code Playground

by LyndseyB

Babel + JSX

function Person(name, age) {
	this.name = name;
  this.age = age;
}

Person.prototype.getAge = function() {
	return this.age;
}

const lyndsey = new Person('Lyndsey', 30);
console.log(lyndsey.getAge());

class PersonClass {
	constructor(name, age) {
  	this.name = name;
    this.age = age;
  }
  
  getAge() {
  	return this.age;
  }
}

const lewwy = new PersonClass('Lewwy', 20);
console.log(lewwy.getAge());