Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

swap key value object javascript

function swap(json){
  var ret = {};
  for(var key in json){
    ret[json[key]] = key;
  }
  return ret;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #swap #key #object #javascript
ADD COMMENT
Topic
Name
4+4 =