class Promise {
constructure(callback) {
this.status = 'pending';
callback(this.resolve, this.reject);
}
then() {
}
resolve () {
try {
} catch {
}
this.status = 'fulfilled"
}
reject () {
this.status = 'rejected'
}
}
const promiseA = new Promise((resolve, reject) => {
resolve(777);
});
https://v8.dev/features/top-level-await
async function as() {
console.log(‘async function’);
var result = await new Promise(resolve => setTimeout(()=> resolve(‘대기끝’),0));
console.log(‘result : ’, result);
console.log(“abcd”)
return result;
}
function sync(num) {
console.log(‘sync’, num);
}
(function() {
sync(1);
var result = as();
result.then((data) => console.log(“data: “, data));
sync(2);
})();
1.3.2
메이저.마이너.패치 업데이트