JSFiddle - React, Tailwind, and code Playground

JavaScript

var A = function()
{
  var internal = 0;
  this.increment = function()
  {
    return ++internal;
  };
};

var B = function() {};
// inherit from A
B.prototype = new A;

x = new B;
y = new B;

z = new A;
z1 = new A;

alert(x.increment() + " - " + y.increment());
alert(z.increment() + " - " + z1.increment());