0 1 00:00:00,650 --> 00:00:07,830 Alright. Onwards and upwards. Challenge 12. In order to complete this challenge the first thing I need you to do 1 2 00:00:07,950 --> 00:00:15,000 is to delete this console log inside our app.js. Make sure that there's no other log statements inside 2 3 00:00:15,000 --> 00:00:23,460 this file other than inside our app.listen because instead of logging the posts inside here, I want you 3 4 00:00:23,460 --> 00:00:26,200 to be able to pass it over to our home. 4 5 00:00:26,370 --> 00:00:27,140 ejs 5 6 00:00:27,300 --> 00:00:30,060 and log it from here instead. 6 7 00:00:30,480 --> 00:00:35,520 There's a couple of steps to this and you might have to think about it but this is the end outcome. You 7 8 00:00:35,520 --> 00:00:38,790 want to be able to log exactly the same thing, the post array, 8 9 00:00:38,790 --> 00:00:44,930 but this time inside the home.ejs. Pause the video, give it a think and give it a go. 9 10 00:00:46,880 --> 00:00:47,140 All right. 10 11 00:00:47,150 --> 00:00:49,400 Here's my first hint. 11 12 00:00:49,400 --> 00:00:52,110 Remember that using res.render 12 13 00:00:52,130 --> 00:00:58,490 the second parameter that we're passing in to this function is essentially a Javascript object. And we've 13 14 00:00:58,490 --> 00:01:03,860 already seen what Javascript objects look like and we know that you can have more than one key value 14 15 00:01:03,860 --> 00:01:08,180 pair as long as you simply just add a comma in between them. 15 16 00:01:08,180 --> 00:01:15,800 So instead of simply just passing over the starting content, we also want to pass over the posts array 16 17 00:01:16,190 --> 00:01:18,810 using this res.render method. 17 18 00:01:18,860 --> 00:01:23,730 So pause the video and see if that was enough of a hint to complete the challenge. 18 19 00:01:23,790 --> 00:01:24,230 All right. 19 20 00:01:24,230 --> 00:01:26,940 Here comes hint number 2. 20 21 00:01:26,960 --> 00:01:33,210 If you look at the EJS docs you know that there's a whole bunch of different tags that we can use. 21 22 00:01:33,470 --> 00:01:39,770 And the one that we've shown you before is the scriptlet tag which allows you to write Javascript inside 22 23 00:01:39,770 --> 00:01:41,110 the EJS file. 23 24 00:01:41,360 --> 00:01:47,990 With that in mind you should be able to complete the challenge and log the posts array from within the 24 25 00:01:47,990 --> 00:01:52,590 home.ejs file. Pause the video and complete the challenge.