underscore each context

http://bugs.jquery.com/ticket/12745

by elgreg

HTML

<h1>Run with console open</h1>

JavaScript

//basic custom object with two properties
var obj = { 
    testA: "please change this",
    testB: "and change this too"
};

//search/replace properties and display result
function doReplace() {
    _.each(obj, function (index, value) {
        console.log(this);
        console.log(index);
        console.log(value);
        //value = newVal;
    });
}
doReplace();