Horje
code in nested forEach loop- react native Code Example
code in nested forEach loop- react native
const nestedPromise = async (items = []) => {
  return await Promise.all(
    items.map(async item => {
      if (Array.isArray(item) && item.length) {
        return await nestedPromise(item)
      }
      // return await call to your function
      return 'response-' + item
    })
  )
}

const items = [ [4, 1, 2], [2, 5] ]
nestedPromise(items).then(results => {
  console.log(results)
})




Javascript

Related
mongoose search by keywords Code Example mongoose search by keywords Code Example
smaler div on devices Code Example smaler div on devices Code Example
clickjacking in react js Code Example clickjacking in react js Code Example
calculate time in seconds javascript Code Example calculate time in seconds javascript Code Example
redblobgames pathfinding Code Example redblobgames pathfinding Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7