JSFiddle - React, Tailwind, and code Playground

by Cody Lindley

HTML

<script src="https://dl.dropboxusercontent.com/u/2026291/firebug-lite-debug.js"></script>

JavaScript

var myObject = {foo:'foo'};

var myFunction = function(){
    //note I am logging this and arguments here
    console.log(this,arguments[0],arguments[1],arguments[2]);
};

var usingBind = myFunction.bind(myObject,1,2,3); //create new function

//when usingBind() is called the this reference, references myObject
usingBind(); //logs {foo="foo"} 1 2 3

//Note, that any additional argumetns sent to bind, are also sent to the original function, i.e. the 1 2 4