Data Abstraction Homework
Quick practice with Javascript Lists
📝 Data Abstraction Hack (10 minutes)
Instructions
In this activity, you’ll learn how lists manage data and reduce complexity in programs. Follow these steps:
- Edit the
studentslist to use your own names (friends, classmates, etc.). - Edit the
scoreslist to assign each student a score of your choice. - Save and refresh the page in your browser to see how the output changes automatically.
- After experimenting with
studentsandscores, complete the 🚀 Hack Challenge at the bottom. - To make edits, open VS Code and find the file at
notebooks/csp/big-ideas/2025-09-26-bigidea32homework.ipymd.
Class Roster Output:
🚀 Hack Challenge
Now that you’ve practiced with students and scores,
it’s your turn! Create one new list of your choice.
✅ Ideas:
- A list of
favoriteFoods - A list of
citiesyou want to visit - A list of
videoGamesyou enjoy
After creating your new list, write a loop to print each element to the page.
// Example structure:
let favoriteFoods = ["Pizza", "Burgers", "Sushi"];
for (let i = 0; i < favoriteFoods.length; i++) {
console.log(favoriteFoods[i]); // Replace console.log with output to the page if you like
}
💡 Hint: Use the same pattern you saw with students and scores.