to return array?
What does it return?
I kind of solved it by removing async await and returns array but can not do map on it Map returns nothing
What does this code return?
This code shows you haven't quite grasped async/await, Array.prototype.map, or promises yet. It mixes async/await with promise chains. In most cases, you pick one or the other It uses Array.prototype.map to modify another array
I like await foo().catch(bar)
If you console.log(app ()) you won't get anything yet cause it is an async function that means it returns a promise. The thing is it does return an array but you only can't access it yet. So the correct method to do and let use console.log as example you have to do it like this : app ().then (arr=>console.log (arr))
Обсуждают сегодня