JSFiddle - React, Tailwind, and code Playground
JavaScript
var Point = (function () {
function Point(x, y) {
this.x = x;
this.y = y;
}
Point.prototype.dist = function () {
return Math.sqrt(this.x * this.y + this.x * this.y);
};
return Point;
})();
var p = { x: 10, y: 20 };
console.log(Point.prototype.dist.call(p));