Skip to content

Instantly share code, notes, and snippets.

@Xedii Xedii/async-start.js Secret
Last active Jan 25, 2019

Embed
What would you like to do?
(async () => {
try {
let data = [];
const arr = await requestMock();
if(arr.data.length) {
const nextArr = await requestMock();
data = nextArr.map(nextEl => nextEl+5)
} else {
data = arr.map(el => el+2)
}
console.log(data);
} catch (err) {
console.log(err);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.