I have an the following array:
var arr = [{name: "one name"}, {name: "second name"}, {name: "third name"}]
My goal is to have array like this:
var result = ["one name", "second name", "third name"]
I am playing around with something like this, just can't get it right:
var result = [];
for (var i=0; i<arr.length; i++) {
result[arr[i]] = arr[i].NAME;
}
What I am misisng?
I am looking how to correct my code and use for loop instead of array map