JSFiddle - React, Tailwind, and code Playground

by JonVisc

HTML

<div id="test"></div>

JavaScript

function test(str) {
    this.name = str;
    $('#test').append(this.name);
}

test.prototype.getGeneric = function() {
    $('#test').append('generic\n');
}

var test1 = new test('test1');
test1.getGeneric();

var test2 = new test('test2');
test2.getGeneric();

test.prototype.nonGeneric = function() {
    $('#test').append(this.name + ' non generic\n');
}

test1.nonGeneric();
test2.nonGeneric();