Core 2: Interaction
Spring 2024

Use this boilerplate to create a JS variable containing the entries for your collection project. Your folder structure should look like this:

πŸ“‚ core-2-interaction/
└─ πŸ“‚ lab/ 
   └─ πŸ“ projects/
      └─ πŸ“ 04_collection-object
         β”œβ”€ πŸ“„ index.html
         └─ πŸ“ assets
            β”œβ”€ πŸ“„ data.js
            └─ πŸ“„ scripts.js

Object Structure

Your πŸ“„ data.js should only have an array named β€œdata” containing your collection’s dataset. Each array element should be an object representing a single entry and containing whatever metadata you decide is relevant to your project. Consider this example dataset describing the cars parked on the street outside of my studio…

var data = [
    {
        make: 'Dodge',
        model: 'Charger',
        year: 2019,
    },
    {
        make: 'Honda',
        model: 'Element',
        year: 2008,
    },
    {
        make: 'Ford',
        model: 'Escort',
        year: 2013,
    },
];

Your page should run without errors upon submission. Remember to use the console log to check for syntax errors!

Resources

Codecademy – Javascript
Eloquent Javascript

Stylesheet