## Getting Started with JavaScript

- MDN JavaScript
- JS Reference (DevDocs)
- W3Schools JavaScript
- Marquis, M. (2016). JavaScript for Web Designers (1st edition). A Book Apart.
- Niederst Robbins, J. (2018). Learning Web design : a beginner's guide to HTML, CSS, Javascript, and web graphics (Fifth edition.). O'Reilly.

### Some basics

- JS in HTML.
  Including JavaScript in HTML with `script` element, with either `src` attribute or JS code.
- Variables.
  Declare variables with `let` and sometimes `const`.
  Though you will see the older `var`, which works but is not preferred.
- Console is your friend.
  Your browser developer tools will be critical to use, and especially the "Console". Log to the console in JS with

      console.log('hello there!');

- When is the code executed?
  `script` in `head` or right before the body close tag - `</body>`
  But it is good practice to rely on specific events!
- Objects
- Conditional flow. `if...else`
- Iterations and Loops. `for...of`
- Functions - named and anonymous
- DOM (Document Object Model)
- Events, Listeners, and Handlers
  `load`, `click`, `focus`, `blur`, `submit`, `mouseover`, `mouseout`, `keypress`.
  HTML attributes are available, but don't use these.
  Add event listeners through JavaScript!