JSFiddle - React, Tailwind, and code Playground

by Zaheer Ahmed

JavaScript

var myClass =function(){};
myClass.prototype.myFunction = function() { 
  alert('Hello class Function');
} 

//now create instance variable
var objectOne = new myClass();
var objectTwo = new myClass();

//now calling myFunction with multiple instances will throw error
objectOne.myFunction();
objectTwo.myFunction();