Skip to content

Instantly share code, notes, and snippets.

@sanlouise
Last active March 12, 2017 22:04
Show Gist options
  • Save sanlouise/5205c4397e2aa37bc1e12b6e77d734e9 to your computer and use it in GitHub Desktop.
Save sanlouise/5205c4397e2aa37bc1e12b6e77d734e9 to your computer and use it in GitHub Desktop.
Turing Prework

Day 1

  1. On a website, what is the purpose of HTML code? HTML is the standard for describing the structure and presentation of information on the Internet. HTML keywords and tags are used to format and display the content of pages on the web.
  2. What is the difference between an element and a tag? An HTML 'tag' is just the opening or closing entity, whereas an 'element' also includes its contents.
  3. Why do we use attributes in HTML elements? Attributes changes the default functionality of an element type.
  4. Describe the purpose of the head, title, and body HTML elements. The head contains metadata, including the title, style elements, meta tags, external links and scripts. The title is what is displayed in the active browser tab. The body contains all the contents of the HTML document.
  5. In your browser (Chrome), how do you view the source of a website? One can use the Developer Tools.
  6. List five different HTML elements and what they are used for. For example, <p></p> is a paragraph element, and it is used to represent a paragraph of text. The <h1></h1> tag is used to signal a major header, <h2></h2> all the way to h6 also indicate headers. An ordered list is created using <ol></ol>, and unordered lists by using <ul></ul>. Elements within the list are marked with <li></li> tags.
  7. What are empty elements? Elements without content between tags, such as the hr tag.
  8. What is semantic markup? The use of HTML to reinforce semantics, such as making text look bold or italicized.
  9. What are three new semantic elements introduced in HTML 5? Use page 431 in the book to find more about these new elements. The nav, aside and article elements.

Day 2

  1. There are three main types of lists in HTML: ordered, unordered, and definition. What are their differences? An ordered list numbers its elements, an unordered list begins with a bullet point (unless specified otherwise), and a definition tabs in the second argument.
  2. What is the basic structure of an element used to link to another website? <a href="http://www.google.com">Google</a>
  3. What attribute should you include in a link to open a new tab when the link is clicked? Add target="_blank" after specifying the url.
  4. How do you link to a specific part of the same page? You can use the id attribute or anchor tags.

Day 3

  1. If you're using an input element in a form, what attribute controls the behavior of that input? The 'type' attribute.
  2. What element is used to create a dropdown list? The <select> element, with <option> elements.
  3. If you're using an input element to send form data to a server, what should the type attribute be set to? 'submit'
  4. What element is used to group similar form items together? The <fieldset> element.

Day 4

  1. In an image element, why is the alt attribute important? If the image does not appear for some reason, the alt text is displayed.
  2. What determines if an image element is inline or block? It matters whether the img element is placed inside or outside of a block element.
  3. What are the benefits of jpg or png image file formats? JPG images lose image wuality and information each time they are saved, resulting in an almost always smaller file size than a PNG.
  4. What is the benefit of specifying the height and width of images in CSS compared to specifying in the HTML? It's important to keep styles seperated from the HTML to not clutter the HTML and enable yourself to modify styles in one place.
  5. What is an image sprite, and why is it useful? An image sprite groups different images together, and is especially useful for displaying controls for, for instance, games.

Day 5

  1. There are three big data types in JavaScript: numbers, strings, and booleans. Describe what each of them are. Numbers are decimals, strings are pieces of text, and booleans are either true or false.
  2. What are the three logical operators that JavaScript supports? They are && (and), || (or), and !expr (not).
  3. What is the naming convention used for variables? For variables in JS, one needs to use camelcase.
  4. What is the difference between an expression and a statement? An expression is assigned to a var, whereas a statement runs inside of a function and returns a value.
  5. What are a few JavaScript reserved words, and why are they important to avoid using them for variable names? One needs to avoid them because these specific words will always perform teh behavior that is assigned to them, a programmer cannot ovveride their behavior.
  6. What is control flow, and why is it useful for programming? Control flow is a specific order in which statements, instructions or functions of a program are executed. A programmer needs to understand the order of execution to achieve the correct behavior.

Day 6

  1. If we have a function defined as function sayHello(){console.log("Hello!")}, what is the difference between entering sayHello and sayHello() in the console?
  2. What is the keyword return used for? It returns a value.
  3. What are function parameters? One can pass data into a function, this data needs to be added as a parameter.
  4. What is the naming convention used for function names? It should be explanatory as to what the function does and should always be camelcase.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment