I need help converting an object into an array using pure javascript.
Here is the object I want to convert:
[{"itemCode":"Mob-mtr"},{"itemCode":"640-chr"}]
This is how I want the array to look like:
["Mob-mtr","640-chr","541-mtr"]
I've attempted this code so far:
var arr = Object.keys(obj).map(function (key) {return obj[key]});
But I haven't had any success. Are there any other methods that I can use to convert this object into an array?