79420774

Date: 2025-02-07 11:52:32
Score: 1
Natty:
Report link
const checkedArray = await Promise.all(
  originalArray.map(async (elem) => {
    const someCheck = await myAsyncCheckingMethod(elem);
    return someCheck ? elem : null;
  })
);
const finalArray.filter((elem) => elem !== null);

Works if you are not expecting nulls as a regular elements in original array

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Tarasko