JSFiddle - React, Tailwind, and code Playground
by ChangJoo Park
JavaScript
var Point = function (x, y) {
this._x = x;
this._y = y;
this.getX = function () {
return this._x;
};
this.getY = function () {
return this._y;
};
this.setX = function (x) {
this._x = x;
};
this.setY = function (y) {
this._y = y;
};
};
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
var points = [];
for(var i = 0 ; i < getRandomInt(0,30);i++){
points.push(new Point(getRandomInt(0 50), getRandomInt(0 50)));
}