javascript swap object key value code example
Example: swap key value object javascript
function swap(json){
var ret = {};
for(var key in json){
ret[json[key]] = key;
}
return ret;
}
function swap(json){
var ret = {};
for(var key in json){
ret[json[key]] = key;
}
return ret;
}