JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://documentcloud.github.com/underscore/underscore.js"></script>
JavaScript
var a = {
name : "Foo",
amount: 55,
reported : false,
date : "10/01/2001"
};
var b = {};
var map = {
name : "id",
amount : "total",
reported : "updated",
date : "issued"
};
_.each(a, function(value, key) {
key = map[key] || key;
b[key] = value;
});
console.log(b);