iterating through arrays via for loops and forEach loops