Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript get object list by value

Object.values = function(obj){
  return Object.keys(obj).map(function(key){
    return obj[key]
  })
}

var a = {2: "test", 3: "test2"};
console.log(Object.keys(a));
console.log(Object.values(a));
 Run code snippet
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #object #list
ADD COMMENT
Topic
Name
4+2 =