How can i return array position of each object in an array.
code
let targets = [1.2, 2.3, 3.5];
let targetUpdatedOn = [2018-07-06, 2018-07-06, 2018-07-06];
let liveCoinPrice = 1.3;
let targets_hit = targets.filter(function(target_value) {
return liveCoinPrice >= target_value;
});
This what is done to find array position.
targets_hit.forEach(function(key) {
if(targetUpdatedOn[key] === undefined){
console.log(targetUpdatedOn);
}
}
I want to return array position of each targets_hits . Any help would be thankful.
targetUpdatedOn?