JSFiddle - React, Tailwind, and code Playground
by Robodude
Babel + JSX
function noAsync(b){
if (b){
return [1,2,3]
}
else {
return Promise.resolve([4,5,6])
}
}
async function asyncStyle(b){
if (b){
return [1,2,3]
}
else {
return Promise.resolve([4,5,6])
}
}
const resultA = noAsync(true)
const resultB = noAsync(false)
console.log(resultA, resultB)
const resultC = asyncStyle(true)
const resultD = asyncStyle(false)
console.log(resultC, resultC)