JSFiddle - React, Tailwind, and code Playground

JavaScript

//let's say X is the constructor
var X = function(){};

//we add an add method to all future instances of X
X.prototype.add = function(){}

//and Y is the instance
var Y = new X();
console.log(Y);