in test.js, I have some callback that resolves "a" value. then further the "a" value is exported at the end of the file
//test.js
let fun = async ()=>{
let a
await setTimeout(()=>{a = 10}, 100)
return a
}
let a
fun().then(val=>{a=val})
export default a
when im trying to import a value in test1.js, im getting a as undefiner
test1.js
import a from './test.js'
console.log(a) //undefined
await setTimeoutmakes no sense sincesetTimoutdoesn't return a Promise