<!DOCTYPE html>
<html>
  <head>
    <title>JAVASCRIPT BASICS</title>
      <meta charset="UTF-8">
      <link href="../styles/main.css" rel="stylesheet" type="text/css">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css">
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.css">
      <link rel="stylesheet" href="styles/main.css">
      <link href="https://fonts.googleapis.com/css?family=Amatic+SC|Fredericka+the+Great" rel="stylesheet">
  </head>

  <body>
  <h1>JAVASCRIPT BASICS</h1>
  <div class="container">
  <h4>Technical Blog Part Four</h4>
  <h5>Terminology: "Learning the Lingo"</h5>

  <strong>How does JavaScript compare to HTML and CSS?</strong>
    <p>
        <strong><em>JavaScript</em></strong> compares differently to HTML and CSS as it is used for website functionality, this means it is able to process data and tells a page how to behave, where as HTML dictates structure, i.e. how the contents is divided, and CSS dictates style, i.e. how the page looks.
    </p>

  <strong> Explain control flow and loops using an example process from everyday life.</strong>
    <p>
        <strong><em>Control flow</em></strong> is the order in which the computer executes statements. <em>Loops</em> offer a quick and easy way to do something repeatedly, changing the control flow of the code. An example of this in daily life would be the process of waking up. The control flow when you wake up is that your alarm goes off, you turn alarm off, you wake up and you take a shower. However as we all know we like to snooze so sometimes when our alarm goes off we will snooze and go back to bed. A loop would then check that we haven't woken up and so the code to take a shower will not run until the condition of us waking up is met. If we are already awake when the alarm goes off the loop will not run at all as the condition has been met.
    </p>

  <strong>Explain the difference between accessing data from arrays and objects</strong>
    <p>
        The difference between accessing data from arrays and objects is that data from an array can only be accessed through bracket notation where as data from an object can be accessed with bracket and dot notation. Also I think arrays are ordered so that you can only add/remove the first and last element where as you can add/remove or modify any property within an object as long as you know the property name.
    </p>

  <strong>Explain what functions are and why they are useful</strong>
      <p>
          <strong><em>Functions</em></strong> are a way for us to give instructions to the computer more efficiently. Imagine us doing a daily task such as cooking. Our Ingredients(inputs) and meal(output) would differ but our method i.e. cook will be the same. Functions let us tell the computer to perform a set of instructions, without typing it over and over again, we just give it different inputs to get the corresponding output.
      </p>
  </div>
  </body>

  <footer>
      <p>
        <a href="../tblog.html">Back</a>
      </p>
  </footer>

</html>
