JavaScript & TypeScript / Quiz
Arrays for Test Data: push, splice, map, filter
Add, remove, slice, search and transform arrays the way test data needs, and learn which methods change the original.
- Difficulty
- Easy
- Format
- Quiz
- Points
- 100
- Estimate
- 7 min
// MISSION BRIEF
Your Mission
Test data is mostly lists: users, status codes, steps, tags. Some array methods change the list in place and some hand you a new one, and mixing them up corrupts shared data.
For each snippet, predict exactly what Node prints. If the code throws, pick the error. Run nothing: read it the way the engine does, top to bottom.
Speed bonus active.
// FIRST CONTACT
Battle teaser
What does this print? If it throws, pick the error. const users = ["asha", "ravi"]; users.push("meera"); users.shift(); console.log(users.join(","));
- Ameera,asha,ravi
- Basha,ravi
- Cravi,meera
- Dasha,ravi,meera
Answers, scoring, hints, and the full battle stay sealed.
// SKILL TAGS
javascriptfundamentalsarraystest-data