Tip of The day — Arrays!

Arrays are all the same in every language. Whenever you see “[],” it will be an array. In addition, the best way to find the array position is by subtracting one.

So lets say you need to find the fourth elements position. You will find it by this formula.

Formula: x - 1 = position

In other words, you subtract 1. Here is an example in javascript:

var awesomeActors = [“Matt Damon”, “Will Smith”, “Leonardo Di Caprio”];

If we wanted to find the third actor we would do “3–1" and we get 2. So we would write something like console.log(awesomeActors[2]); to display Leo.

Thats my tip of the day!

hip hip [ARRAY!]!!