code: async function filterAsync(array, callback) {
    const inputArray = Array.isArray(array) ? array : [array];
    const values = [];
    for (let index = 0; index < inputArray.length; index++) {
      try {
        const res = await callback(inputArray[index], index, inputArray);
        const value = Array.isArray(res) ? res[0] : res;
  
        if (value) {
          values.push(inputArray[index]);
        }
      } catch (err) {
        throw err;
      }
    }
    return values;
  }
docs: Mimic Array.filter() API, but with an async callback function. Execute each callback on each array item serially. Useful when using WebDriver API. Added due because of problem with chrome driver when too many requests are made simultaneously. https://bugs.chromium.org/p/chromedriver/issues/detail?id=2152#c9 @param {object[]} array Input array items to iterate over @param {function} callback Async functin to excute on each array item @param {object} option Additional options. 'extractValue' will extract the .value object from a WebdriverIO