ควิซ JavaScript: Destructuring & Spread

Destructuring and the spread syntax show up in almost every modern JavaScript file. This quiz checks array and object destructuring, default values, renaming, rest elements and how spread copies and merges.

ง่าย 10 ข้อ ~5 นาที ผ่านที่ 80% Node.js 22

เลือกโหมด

กำลังเล่นแบบผู้เยี่ยมชม: เข้าสู่ระบบเพื่อเก็บ XP และ streak

ตัวอย่างคำถาม

ข้อ 1 จาก 10

What does this print?

const [a, b] = [10, 20, 30];
console.log(a, b);
ดูเฉลย

A. 10 20 Array destructuring takes items by position, so a gets the first item and b the second. Extra items are simply ignored.

ควิซนี้มีเนื้อหาอะไรบ้าง

  • Array and object destructuring
  • Default values and renaming
  • Rest elements with ...
  • Merging objects and arrays with spread
  • Destructuring function parameters

คำถามที่พบบ่อย

ต้องมีบัญชีไหม?

ไม่ต้อง ใครก็เล่นได้ เข้าสู่ระบบเพื่อเก็บ XP, streak, เหรียญตรา และประวัติ

ทำซ้ำได้ไหม?

ได้ ระบบเก็บคะแนนที่ดีที่สุดไว้ และสลับคำถามกับตัวเลือกใหม่ทุกครั้ง