JavaScript seems much more involved than just getting the correct structure in order to display content in the right way. JavaScript allows interactivity as the code will produce different results depending on what the user does.
They are conditional statements which produce a different result depending on what the input is. For example, walking the dog. IF I didn't sleep in, & it's not raining, then I will walk him before work. Otherwise, if I didn't sleep in, and it is raining, and the forecast for the afternoon is fine, then I will walk him after work. If I did sleep in, whether it is raining or not, I will walk him after work. These variables determine the outcome, and include and exclude different factors to reach it.
Accessing data from an array you can use data[num] (num being the index number of the data you want to receive from the array, starting at 0 for the first piece fo data.) To access data from an object you can use the group name and the property of the data you need using groupName.data or groupName[data].
A function is a piece of code which has a particular purpose or function. Functions are useful because you can refer back to functions many times without having to rewrite it - you just change the variable.