JSFiddle - React, Tailwind, and code Playground

by f0t0n

JavaScript

'use strict';

(function(g) { // g is a global context (this passed)

    if(typeof g.Array != 'undefined') {
        return;
    }
    g.Array = function() {
        // ...
    };
    
    g.Array.prototype.foo = function() {
        console.log('bar');
    };
})(this);

console.log(this.Array);