Initial commit
This commit is contained in:
16
Promise/promise.js
Normal file
16
Promise/promise.js
Normal file
@@ -0,0 +1,16 @@
|
||||
function getMessage() {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve("Wiadomość odebrana!");
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
async function showMessage() {
|
||||
const msg = getMessage();
|
||||
console.log(msg);
|
||||
}
|
||||
|
||||
showMessage();
|
||||
|
||||
//Co zwróci console.log, Czego brakuje w tym kodzie
|
||||
Reference in New Issue
Block a user