
Quiz tentang Promise dan Async/Await
Quiz
•
Information Technology (IT)
•
1st Grade
•
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
15 questions
Kuis Personal Branding
Quiz
•
1st Grade
10 questions
Incident Response Dikualsus Kamsiber TNI AU TA 2025
Quiz
•
1st - 5th Grade
10 questions
SEJARAH TIK
Quiz
•
1st Grade
15 questions
Quiz Profil Pelajar Pancasila dalam Informatika
Quiz
•
1st Grade
10 questions
Quiz Sejarah Kemerdekaan Indonesia 1
Quiz
•
1st Grade
15 questions
Bab 3 Bagian A-D Pengenalan Komputer
Quiz
•
1st Grade
10 questions
Kuis AI dalam Pendidikan
Quiz
•
1st Grade
10 questions
Internet S.A.F.E Kuiz
Quiz
•
1st - 5th Grade
Popular Resources on Wayground
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
4 questions
Activity set 10/24
Lesson
•
6th - 8th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
How to Email your Teacher
Quiz
•
Professional Development
15 questions
Order of Operations
Quiz
•
5th Grade
30 questions
October: Math Fluency: Multiply and Divide
Quiz
•
7th Grade
Discover more resources for Information Technology (IT)
6 questions
Gravity
Quiz
•
1st Grade
4 questions
What is Red Ribbon Week
Interactive video
•
1st - 5th Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
18 questions
Pushes & Pulls
Quiz
•
1st - 4th Grade
20 questions
Multiplication Mastery Checkpoint
Quiz
•
1st - 5th Grade
16 questions
Halloween Candy
Quiz
•
KG - 12th Grade
25 questions
Week 1 Memory Builder 1 (2-3-4 times tables) Term 2
Quiz
•
1st - 5th Grade
10 questions
Exploring Common and Proper Nouns
Interactive video
•
1st - 5th Grade
