Skip to content

Instantly share code, notes, and snippets.

@stujo
Last active August 29, 2015 14:08
Show Gist options
  • Save stujo/4b8342d171f775b326db to your computer and use it in GitHub Desktop.
Save stujo/4b8342d171f775b326db to your computer and use it in GitHub Desktop.
JavaScript Intro Notes

#Javascript Intro

#What the Week Looks Like

  • Intro to JavaScript
  • DOM Manipulation
  • Object Oriented JavaScript
  • EventLoop
  • jQuery
  • AJAX
  • MVC in JavaScript
  • Testing!

#Lecture Overview

  • Prepare for Javascript Challenge

  • Where to put it

  • Debugging

  • What's different?

  • JavaScript Types

  • It's All Event Driven - Event Handlers

  • 'use strict';

#Prepare for Javascript Challenge

#Where to put it?

#Debugging

  • Chrome Dev Tools ALL THE TIME
  • debugger

#What's different?

  • var to declare a variable
  • function to begin a function definition
  • { this is a block }
  • a statement is ended with ;
  • ( an expression )
  • Loops: for(var i=0 ; i < 10; i++){}
  • this kind of like self
  • Gotchas
    • functions are first class
    • No Block Scope - Only Function Scope
    • == uses type coersion! So always use ===

#JavaScript Types *JavaScript Primitive (literal) Values

  • String
  • Boolean
  • Undefined
  • Null
  • Number

*Javascript Reference Types

  • Object
  • Array
  • Function
  • Date
  • RegExp

#It's All Event Driven

  • Understand Function references
  • Attach functions as Event Handler Callbacks
    • window.addEventListener('load', callback, false);
    • document.getElementById('mybutton').addEventListener('click', callback, false);
    • document.querySelector('#mybutton').addEventListener('click', callback, false);
    • document.querySelectorAll('button')[0].addEventListener('click', callback, false);

#Pro Tips

#Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment