Here is my anology of a webpage using a Wharenui also known as meeting house. The html is the body of any page and in this case would be my Wharenui, holding together all foundation components, Then we have css, the look of the Pou, Kowhaiwhai, Tukutuku and where they are place, the colour and style. finishing off with Javascript the hau kainga, Everybody that keeps the Marae running. without the people a Marae won't work and without Javascript a webpage will be just the body and look.
CONTROL FLOW: You like to cook? So do I am a chef. Okay so the control flow is a recipe for the compute to follow set instruction, top to bottom.
LOOPS : This is exactly how it sounds, a piece of code that repeats itself, till told otherwise. Having dinner cook in the oven untill you turn it off, in thise case the oven is like the compute it won't stop untill the loop is told too.
You can look at the DOM as a Whakapapa, Family tree. From the DOM, Javascript is able to edite anything inside the webpage to help it Pop! make it look great. here is a image of a DOM.
Let's get back to the cooking side of things, If you feel you are repeating some steps, we call it functions. A set of insctutions that we want the computure to do, say it once with a name and you can have that inscrution repeated as much as you want.
Variables are used for different types of info so we are able to use it later on.