← ⚡ JavaScript World
⚡ No Duplicates Allowed
You can practise without a player, but pick a player to score points!
📖 The mission
Today you unlock
Loops inspect each item
Many levels use a loop: start with a simple value, visit each item, update the answer, then return it at the end.
💡 Hint ladder
- Keep a result array; only push items you have not seen yet.
- items.includes(x) or a Set can check "seen before".
- One-liner: [...new Set(items)]
🧪 Coach checks
- ◯ removes repeats
- ◯ numbers too
- ◯ already unique
- ◯ empty stays empty
Live coach
Getting ready
☆☆☆
💬 includes() asks "have I seen this before?" — perfect for skipping repeats.
const seen = ["a", "b"];
console.log(seen.includes("a")); // true
console.log(seen.includes("z")); // false
📟 It printed:
Nice — you saw it work!
📟 Output
🧩 Gaps filled! Ready to write it all yourself?