JSFiddle - React, Tailwind, and code Playground

by cheeaun

JavaScript

function Foo(){}

Foo.prototype = {
  test: function() {
    alert('bar');
  }
};

var a = Foo.prototype.test;
Foo.prototype.test = function(){
    alert('foo');
    a();
    alert('foo');
};

var f = new Foo();
f.test()