let obj = {
key1: 'value1',
key2: 'value2',
}
let obj2 = { ...obj, key3: 'value3'};
const promise = new Promise((resolve, reject) => {});
promise
.then(()=>{})
.finally(()=>{});
const foo = async () => {
let time = 1000;
const promises = ["a", "b", "c"].map((str) => {
return new Promise((res, rej) => {
setTimeout(() => res(str), (time += 1000));
});
});
for await (const result of promises) {
console.log(result);
}
};