S
const sleep = m => ({
then(f) {
setTimeout(f, m)
}
})

Size: a a a
S
const sleep = m => ({
then(f) {
setTimeout(f, m)
}
})
DE
NR
r
DE
const sleep = m => ({
then(f) {
setTimeout(f, m)
}
})
DE
L
const s=sleep(1000);будет ждать 2 сек
await s;
console.log('x')
await s;
console.log('x')
S
const s=sleep(1000);будет ждать 2 сек
await s;
console.log('x')
await s;
console.log('x')
DE
NR
const s=sleep(1000);будет ждать 2 сек
await s;
console.log('x')
await s;
console.log('x')
r
DE
const s=sleep(1000);будет ждать 2 сек
await s;
console.log('x')
await s;
console.log('x')
DE
L
NR
СК
F
NR
DE
F
const sleep = m => ({
then(f) {
setTimeout(f, m)
}
})