JSFiddle - React, Tailwind, and code Playground

by Michele Marcucci

HTML

<div id="messageArea"></div>

JavaScript

function xyPoint(x, y){
    this.x = x;
    this.y = y;
    this.debugMessage = function(){
        document.getElementById("messageArea").innerHTML =
                "xyPoint(x, y) constructor called";
    };
}

var myPoint = new xyPoint(10, 20).debugMessage();