So I have an array where I need to filter it from undefined
values and then use it (please see the following example!) so since filter method is async there is no guarantee that results array is filtered where I'm logging it!
//Here I need to filter the results from undefined!
results = results.filter(function (item) {
return item !== undefined;
});
//But since the filter method is async, it is not guaranteed that results is filtered here yet!
console.log(results)