JSFiddle - React, Tailwind, and code Playground

by karin

HTML

<p id="per"></p>

JavaScript

function Person(first, last) {
    this.first = first;
    this.last = last;
}

Person.prototype.fullName = function () {
    return this.first + ' ' + this.last;
};
var s = new Person("Simon", "Willison");
document.getElementById('per').innerHTML = s.fullName().toUpperCase();