JSFiddle - React, Tailwind, and code Playground

by Vladymyr Shevchuk

JavaScript

var A = function() {
    this.param1 = 'string1';
    this.param2 = 'string2';
    
    this.test = function() {
        console.error('prototype test');
    }
};

var a = new A();

a.prototype = new A;
a.param1 = 'riba';
a.test = function() {    
    console.error('test');
    a.prototype.test();
};

console.log(a);
console.log(a.test());