JSFiddle - React, Tailwind, and code Playground

by yi hom

JavaScript

function Person(first, last) {
  this.first = first;
  this.last = last;
  this.fullName = function() {
    return this.first + ' ' + this.last;
  };
  this.fullNameReversed = function() {
  return this.last + ', ' + this.first;
  };
}
var s = new Person("Simon", "Willison");
a = s.fullName();

document.write(a);