All right. Time for challenge 13. The goal of this challenge is such that when you head over to the compose 1
page and you create a number of posts, one is called Day 1, one's called Day 2, one's called day 3 and then you hit publish 2
and you publish all three posts, 3
you have to do this three times. 4
But at this point if you head over to your terminal you should see each of the post titles printed out. 5
So the first time when I created a post, it only printed out the first title, the second time it printed 6
the first and the second title and a third time just now it printed all three titles that I've created. 7
This is no longer the entire posts array but it's actually posting each and every title inside the array. 8
So in order to do this, you'll need to write a FOR loop inside the homeeks that loops through this 9
post array and console logs each and every title, 10
the titles of each of these posts. And to test it you should have a minimum of two posts so that you 11
can make sure that you are indeed printing out all of the titles inside the posts array. Pause the video and complete 12
this challenge. 13
All right here comes my first hint. 14
Now remember that to create a FOR loop 15
this is the standard format. And you first start off from zero and then you put an upper bound when you 16
want the FOR loop to stop, 17
so how many times do you want the loop to run. 18
Then you increment through the FOR loop one at a time and that allows you to tap into this thing called 19
i which will change from 0 to 1 to 2 until the upper bound. 20
And this means that if you add an array then you can tap into the zeroth item, the first, the second, the 21
third and that means you can loop through the array and do whatever it is you need with each of the 22
items inside the array. 23
So see if that's enough of a hint for you to be able to complete this challenge. 24
Now my second hnt is that in our case, the upper bound inside our FOR loop will be the number of posts inside 25
our posts array. 26
If there's only one item inside posts array then the upper bound will simply be one 27
and if there's 10 items inside our posts array, then the upper bound will be 10. 28
In order to do that dynamically remember you can tap into array.lent,h so posts.length. 29
I hope that's enough of a hint for you to be able to 30
now complete the challenge.