JSFiddle - React, Tailwind, and code Playground

by Michael Prosser

JavaScript

function variables(){

  this.x = 1;
  this.y = 2;

  this.setX = function(v){

    this.x = v;

  }

}

let xx = new variables();

xx.setX(11);

console.log(xx.x);