# Week 4 - Arrays, Math, Errors

# Array Loops

Once you understand what arrays are and how you can add and remove values from an Array, then you need to know how to loop over the values.

We already discussed the for...loop method last week, and that works fine but there are actually built-in methods designed to loop over Arrays for specific purposes.

forEach and map

# Array Methods

There are A LOT of methods that belong to Array Objects.

Come back to this Array tutorial page for a full reference to the abilities of Arrays.

# Math and Number Objects

JavaScript has a built-in Object called Math. This Object contains all the methods for dealing with things like rounding numbers off, trigonometry, and random number generation.

Number is one of our Primitive types, but just like String, it also has an Object hiding behind the scenes which gives use some properties and methods for manipulating the numeric values.

Learn the basics about the Math and Number Objects

# Error Objects

An exception is a condition that interrupts normal code execution.

We will use the terms Errors and Exceptions interchangeably.

In JavaScript Errors can occur for a variety of reasons. There are ways that we can handle those without letting our program crash.

Learn about try, catch, and throw

# Other Loop Types

In addition to the basic for...loop and the Array forEach method, there are other types of loops too. While for and forEach will fit most cases, it is good to be aware of the alternatives too.

Learn about other loop types

# More about Objects

Once you understand how to create Object literals with their properties, now it is time to start manipulating those objects. We can test for the existence of Object properties, add new properties, update the value of properties, and even delete properties.

Learn more about manipulating Objects

# TODO

TODO Before next week

  • If you have not read all these notes and watched the videos from this week, do that first.
  • Finish and submit the exercises Exercise 5 - Object Props and Exercise 6 - Strings before 5pm on this Tuesday.
  • Complete Hybrid 6 - Namespaces before next Monday at 5pm.
  • Read ahead the notes for week 5 to prepare for class.
Last Updated: 10/5/2020, 4:12:08 PM