WEBVTT 0 00:00.650 --> 00:07.830 Alright. Onwards and upwards. Challenge 12. In order to complete this challenge the first thing I need you to do 1 00:07.950 --> 00:15.000 is to delete this console log inside our app.js. Make sure that there's no other log statements inside 2 00:15.000 --> 00:23.460 this file other than inside our app.listen because instead of logging the posts inside here, I want you 3 00:23.460 --> 00:26.200 to be able to pass it over to our home. 4 00:26.370 --> 00:27.140 ejs 5 00:27.300 --> 00:30.060 and log it from here instead. 6 00:30.480 --> 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 00:35.520 --> 00:38.790 want to be able to log exactly the same thing, the post array, 8 00:38.790 --> 00:44.930 but this time inside the home.ejs. Pause the video, give it a think and give it a go. 9 00:46.880 --> 00:47.140 All right. 10 00:47.150 --> 00:49.400 Here's my first hint. 11 00:49.400 --> 00:52.110 Remember that using res.render 12 00:52.130 --> 00:58.490 the second parameter that we're passing in to this function is essentially a Javascript object. And we've 13 00:58.490 --> 01:03.860 already seen what Javascript objects look like and we know that you can have more than one key value 14 01:03.860 --> 01:08.180 pair as long as you simply just add a comma in between them. 15 01:08.180 --> 01:15.800 So instead of simply just passing over the starting content, we also want to pass over the posts array 16 01:16.190 --> 01:18.810 using this res.render method. 17 01:18.860 --> 01:23.730 So pause the video and see if that was enough of a hint to complete the challenge. 18 01:23.790 --> 01:24.230 All right. 19 01:24.230 --> 01:26.940 Here comes hint number 2. 20 01:26.960 --> 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 01:33.470 --> 01:39.770 And the one that we've shown you before is the scriptlet tag which allows you to write Javascript inside 22 01:39.770 --> 01:41.110 the EJS file. 23 01:41.360 --> 01:47.990 With that in mind you should be able to complete the challenge and log the posts array from within the 24 01:47.990 --> 01:52.590 home.ejs file. Pause the video and complete the challenge.