JSFiddle - React, Tailwind, and code Playground

by alexflav23

JavaScript

function inherits(child, parent) {
  function temp() {};
  temp.prototype = parent.prototype;
  child.prototype = new temp();
  child.prototype.constructor = child;
};

var SongApi = function() {
};

SongApi.prototype.goPlaySong = function() {
    document.body.innerHTML += "<p>" + "original method" + "</p>";
};

var CustomizedApi = function() {
    SongApi.call(this);
};
inherits(CustomizedApi, SongApi);
/**
 * @override
 */
CustomizedApi.prototype.goPlaySong = function() {
   document.body.innerHTML += "<p>" + "OVERRIDE" + "</p>";
};
var api = new CustomizedApi;
api.goPlaySong();