โ† Home Creator Path ๐Ÿ’Ž

Crystal Scanner

83
Day 1 ๐Ÿ”ฅ
๐ŸŽฏ Today's Missions
๐Ÿ’Ž ๐Ÿ”ฎ โ›๏ธ ๐Ÿ—๏ธ
๐Ÿ’Ž
Crystal Cavern Universe
Crystal Scanner
The Deep Vault holds 2000-year-old crystal formations โ€” but touching the wrong one triggers an ancient trap! ๐Ÿ’Ž In Crystal Cavern you learned to .sort() them. Now you need to ASK QUESTIONS: does this vault CONTAIN a blue crystal? (.some()) Are ALL crystals worth over 100? (.every()) The Crystal Scanner gives true or false in milliseconds โ€” and the wrong answer seals the cavern FOREVER!

๐Ÿ’Ž What we're MAKING today: My Crystal Scanner

In Crystal Cavern you used .sort() to re-order crystals. Today you meet two new superpowers that don't change or remove anything โ€” they just ask a yes/no question about the whole cave!

.some() โ€” scans the vault and answers: "Is there AT LEAST ONE crystal like this?" It stops the moment it finds one. .every() โ€” scans and answers: "Do ALL crystals match?" It stops the moment one breaks the rule. Both return true or false โ€” a single answer for the whole collection!

๐Ÿ”— Last time (Crystal Cavern) you re-ordered crystals with .sort(). Today: no crystals are moved or changed โ€” you're just asking questions. 5 crystals in, 1 TRUE/FALSE answer out. That's the Scanner! ๐Ÿ’Ž
scanner.js JavaScript

    
๐Ÿ’ก Tap a query type below โ€” watch the code line change LIVE! .some() / .every() โ†’ true / false
crystal vault LIVE
๐Ÿ’Ž SCANNER READY
๐Ÿ” CRYSTAL SCANNER
Tap a query, then press โ–ถ Scan Vault โ€” the Scanner tells you TRUE or FALSE!
โ†ข Crystals
5
Result
โ€”
๐Ÿ… Rank
Apprentice
Challenge 1 / 5
Vault Alert! Check if any crystal is worth over 200โ€ฆ
๐Ÿงฉ Choose ONE query to run PICK ONE
๐Ÿ’Ž The Scanner checks every crystal and returns TRUE or FALSE. The code line updates the moment you pick a query!
๐Ÿ“‹ Your 5 Crystal Challenges
0 of 5 challenges scanned
๐Ÿ’Ž
You Mastered Crystal Scanner!
Two questions, instant answers โ€” you navigated the Deep Vault like a true Crystal Guardian. The ancient seals stay open and the treasures are safe! ๐Ÿ”ฎ

๐Ÿ’ซ What You Learned

  • .some() โ€” Asks "Is there AT LEAST ONE item that passes my test?" Returns true if any match, stops early
  • .every() โ€” Asks "Do ALL items pass my test?" Returns true only if every single one passes, stops on first fail
  • Both return a single true/false โ€” a yes-or-no answer for the whole cave
  • Together with .filter(), .map(), .sort(), .find(), you now have the complete toolkit for answering any question about an array!
  • Real coders use .some()/.every() to check permissions, validate forms, and test game rules โ€” now you do too! ๐Ÿ’Ž
๐Ÿ’Ž Your Creation
My Crystal Scanner
๐Ÿ’Ž Come Back Tomorrow!
Next up: Neon Beacon โ€” a new universe! You'll build a real-time display that tracks scores, highlights leaders, and updates live as data changes. Think: a sports scoreboard powered by JavaScript! โšก
๐Ÿ  Home
Nice! ๐ŸŽ‰