Constructor Functions
File Location
We will be working in the following file:
You've seen a few times that objects can be created from models. The actual name for this is a "constructor function"; literally, a function that constructs an object. You will be using these quite often in the future, especially once you reach React.js and the Angular framework. For now, just another review.
Practice
Re-create the people objects from the previous module, but this time use a constructor function. Then put them in an array.
Print the properties of each person to the console. However, this time iterate through the array and group the properties together by type, like this:
Bonus Challenge
Come up with another challenge or two on your own based around objects. Slack them to the instructor.
Last updated