
Quiz tentang Promise dan Async/Await
Quiz
•
Information Technology (IT)
•
1st Grade
•
Practice Problem
•
Medium
Vicky Rolanda
Used 1+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Menurut sumber, apa saja tiga status utama (state) yang dimiliki oleh sebuah objek Promise?
Loading, Success, Error
Running, Finished, Stopped
Executing, Fulfilled, Rejected
Pending, Success, Failure
Pending, Fulfilled (Resolved), Rejected
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Sebelum adanya Promise, pengelolaan kode asinkronus sering mengandalkan callbacks. Masalah apa yang diatasi oleh Promise terkait penggunaan callbacks yang berlebihan, yang menghasilkan struktur kode rumit dan sulit dibaca?
Memory leak
Global scope pollution
Blocking main thread
Deadlock
"Callback hell"
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Promise adalah objek yang merepresentasikan hasil akhir dari operasi asinkronus. Metode Promise manakah yang dijalankan terlepas dari apakah Promise berakhir sebagai Fulfilled (Resolved) atau Rejected, dan biasanya berguna untuk pembersihan (cleanup) seperti menghentikan loading spinner?
.then()
.catch()
.execute()
.resolve()
.finally()
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Async/await adalah sintaks yang dibangun di atas Promise untuk membuat kode asinkronus terlihat seperti sinkronus. Kata kunci manakah yang digunakan untuk mendeklarasikan sebuah fungsi agar secara otomatis membungkus nilai yang dikembalikan dalam sebuah Promise?
await
Promise
return
function
async
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Fetch API adalah interface modern untuk membuat permintaan HTTP asinkronus yang berbasis Promise. Dalam konteks Fetch API, mengapa Promise yang dikembalikan oleh fetch() tidak otomatis di-reject ketika terjadi kesalahan HTTP seperti status 4xx atau 5xx?
Karena Fetch hanya mendukung metode GET, bukan POST.
Karena objek Response sudah menyediakan nilai sukses/gagal di properti response.text().
Karena error tersebut secara otomatis ditangani oleh try-catch.
Karena parsing data (misalnya response.json()) akan menangkap semua jenis error.
Karena Fetch tidak me-reject Promise untuk kesalahan status HTTP (4xx/5xx), sehingga kita harus cek manual menggunakan if (!response.ok)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Dalam sintaks Async/Await, kata kunci await digunakan di dalam fungsi asinkronus (async function). Apa fungsi spesifik dari kata kunci await?
Untuk mendeklarasikan fungsi yang mengembalikan Promise.
Untuk menjalankan banyak Promise secara paralel menggunakan Promise.all().
Untuk mengubah hasil Promise menjadi callback function.
Untuk menangani rejection menggunakan blok catch.
Untuk menjeda eksekusi fungsi asinkronus hingga Promise yang dioperasikan telah resolved dan mengembalikan nilainya
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Promise memiliki mekanisme untuk menangani kegagalan operasi. Metode apa yang digunakan untuk menangani rejected error dari Promise, mirip dengan fungsi try-catch dalam kode sinkronus?
.then()
.finally()
.execute()
.resolve()
.catch()
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Scratch Scratching
Quiz
•
1st - 5th Grade
10 questions
Wavemaker Basics
Quiz
•
1st Grade
15 questions
Kelas 3 Bab 4 BagianD-F Membuat Presentasi
Quiz
•
1st Grade
15 questions
UH2 KELAS 4 SD
Quiz
•
1st - 5th Grade
15 questions
Bab 2 Bagian A-C Teknologi Informasi dan Komunikasi
Quiz
•
1st Grade
7 questions
ACQ DAY 2 - Kategori 1
Quiz
•
1st - 5th Grade
5 questions
Soal Koding & Kecerdasan Artifisial untuk SMA/SMK
Quiz
•
1st Grade
10 questions
Quiz Komputer dan Teknologi Pertemuan 4
Quiz
•
1st Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
Discover more resources for Information Technology (IT)
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
10 questions
Christmas/Winter
Quiz
•
KG - 2nd Grade
16 questions
Christmas 1st grade
Quiz
•
1st Grade
10 questions
Exploring the Water Cycle
Interactive video
•
1st - 5th Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
20 questions
Modules 4 - 6 CBA Review
Quiz
•
1st Grade
10 questions
Exploring the American Revolution
Interactive video
•
1st - 5th Grade
