/objects

Primary LanguageJavaScript

Objects - Additional Practice

Notes: Object Oriented Programming is one of the most popular patterns of programming. You'll also see this in other programming languages such as Ruby and Python.

When we program with objects, we model our data as if they were things we see in the real world. For example, what properties do people have? They have a first name, a last name, a height, and much more. They also have plenty of actions that they can perform, such as talking and walking.

We'll start to use objects to represent our data. We'll practice creating objects to represent animals.

Arrays are a simpler data structure compared to objects. In a real-world context, you can think of them as shopping lists. A shopping list has a certain order to it; we can read from the list, and we can also add to the list. We'll practice working with arrays and loops to see how they can keep our code DRY and reusable.

Exercise

Requirements

  • Follow the instructions provided in the main.js file in the starter-code folder.
  • Open the index.html file and examine the console in the Developer Tools. Look here to see if your code is producing the correct results.
  • Determine a test to validate your code.

Resources

MDN Reference for Arrays

MDN Reference for the DOM