All right.
Time for another challenge.
Now currently we've got two inputs inside our form.
One is called post body and one is called
post title. And we know the inside our app.js we currently can log the post title that gets sent
to our compose route through the post requests that the form initiates.
So when we click the submit button we send over two pieces of data,
the text area and the input.
So if we wanted to we could console log the post body that's the text that's inside the text area as
well.
So now if I go ahead and head over to our compose page and refresh and I just type some stuff in here
and I hit publish and I go over to my console then you can see that everything I just typed gets logged
in here because I'm tapping into that variable
post body which is what I defined inside the name for our text area.
The next challenge is instead of console logging the post body or the post title inside this callback
I want you to create a Javascript object that's simply just called post and it has to store both the
title that gets passed over as well as the post body that gets passed over.
So pause the video and try to complete that challenge.
All right so if you've forgotten how Javascript objects look in terms of their syntax then take a look
at my first hint.
So this is how you would create a standard Javascript object.
You would have a var keyword to show that you're creating a new variable.
And then you would give your new object a name whatever it is you wish.
And then you would have an equal sign and you would open up a set of curly braces.
Now inside the curly braces you can have key value pairs and as many as you wish.
You can even nest key value pairs as the value of a particular key.
The parts in purple are the parts that you would need to change in order to create a custom object.
So with this hint in mind now try and complete the challenge.