javascript swap key value of object -lodash 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;
}