16 lines
318 B
JavaScript
16 lines
318 B
JavaScript
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
|