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 arrayLikeObject = {0:'f',1:'o',2:'g',length:3};
//call foreach, set the callback this value to arraylikeObject
[].forEach.call(arrayLikeObject,function(item){
//inside of function this = arrayLikeObject
console.log(item + ' total: ' + this.length);
},arrayLikeObject); //notice third argument, passing arraylikeObject