JSFiddle - React, Tailwind, and code Playground

by NerfAnarchist

JavaScript

// object prototype that does not affect jQuery

// OBJECT PROTOTYPE BOILERPLATE "foo" IS THE FUNCTION NAME THE CONTENTS OF VALUE IS THE FUNCTION
Object.defineProperty(Object.prototype, 'foo', { 
    value: function (test) {
        console.log(this);
        return test;
    },
    enumerable : false
});
// run like this
var test = {test:'asdf'};
console.log(test.foo('asdf'));