Foundations

Fundamentals Part 5

Foundations Course

Introduction

Congratulations on making it to one of the last lessons in Foundations! By this point, you have learned many of the fundamentals of JavaScript. In this lesson, you will learn about Objects - a collection of key-value pairs - as well as some more powerful and commonly used array methods. Before you know it, you’ll have a better understanding of how powerful objects and arrays are and how both can be an indispensable part of your JavaScript tool kit!

Lesson overview

This section contains a general overview of topics that you will learn in this lesson.

  • Creating objects.
  • Accessing object properties.
  • Being able to use multiple object operators.
  • Being able to use some powerful array functions.

Objects

Objects are a very important part of the JavaScript language, and while for the most part you can accomplish simple and even intermediate tasks without worrying about them, any real project that you’re going to attempt is going to feature Objects. The uses of Objects in JavaScript can get deep relatively quickly, so for the moment we’re only going to cover the basics. There’ll be an in-depth dive later.

  1. This JavaScript.info article is the best place to get started with Objects.
  2. The MDN tutorial isn’t bad either, so check it out if you need another take on the subject.

Intermediate/advanced array magic

Besides being a quick and handy way to store data, arrays also have a set of functions for manipulating that data in very powerful ways. Once you begin to master these functions you will start to see ways to use them all over the place! There are really only a handful of these functions… but as you’ll soon see, the possibilities of what you can do with them are near endless.

  1. Start out by watching this video from Wes Bos. To follow along, use your local Javascript30 repository. If you don’t have the repo yet, clone it from here.
  2. Watch and code with Part 2 of Wes Bos’s array series.
  3. For a more comprehensive and in-depth guide to array methods in JavaScript, you can also check out this array method guide. This resource covers each method in detail, with examples and explanations of their usage.

Assignment

  1. At this point you just need a little more practice! Go back to the JavaScript exercises repository that we introduced in the Fundamentals Part 4 assignment. Review each README file prior to completing the following exercises in order:
    • 08_calculator
    • 09_palindromes
    • 10_fibonacci
    • 11_getTheTitles
    • 12_findTheOldest

    Note: Solutions for these exercises can be found in the solution folder of each exercise.

If you feel yourself getting overwhelmed or stuck, don’t be afraid to go back and review or ask for help on our Discord!

Knowledge check

This section contains questions for you to check your understanding of this lesson on your own. If you’re having trouble answering a question, click it and review the material it links to.

Additional resources

This section contains helpful links to related content. It isn’t required, so consider it supplemental.