JSFiddle - React, Tailwind, and code Playground

by Trần Ngọc Minh

JavaScript

function Point (x, y)

{

          this.x = x;

           this.y = y;

}

 Point.prototype.add = function()

            {

                        return this.x + this.y;

}

 var p1 = new Point (3, 5);

alert (p1.add());// 8