[Solved] Reducing object to simple array


Solution 1

var obj= {
  0: "United States",
1: "India",
2: "Germany",
3: "Brazil",
4: "Taiwan",
5: "Israel",
6: "United Kingdom"
}

var result = Object.values(obj)

console.log(result);

Solution 2

var result = Object.keys(obj).map(function(key) {
  return obj[key];
});

console.log(result);

1

solved Reducing object to simple array