Hi for me async and await is quiet new .I have function call which requires await method so as a result i need to use async and await. I'm getting the values but they are not in order.
Below is my async and await map function
items.map(async (item) =>{
const itemx = await
Promise.all([w.getFileByServerRelativeUrl(item.FieldValuesAsText.FileRef).getItem()]);
var likes = await Promise.all(itemx.getLikedByInformation());
const comments = await Promise.all(itemx.comments.get());
articles[i].likecount = likes.likeCount
articles[i].commentcount = comments.length
articles[i].FileRef = item.FieldValuesAsText.FileRef
newst.push(articles[i++])
})
Any suggestion will really be helpful
icoming from and why are you incrementingj?