Skip to content

Instantly share code, notes, and snippets.

@chadfurman
Created January 24, 2017 13:55
Show Gist options
  • Save chadfurman/0aec51b61b851f6c10347605ce7279fb to your computer and use it in GitHub Desktop.
Save chadfurman/0aec51b61b851f6c10347605ce7279fb to your computer and use it in GitHub Desktop.
meeting notes 2

Meeting Notes:

  • Discussed reviewing meeting notes at the end -- divide and conqueror? Putting together a nice writeup for each day?
  • Talked about note writing techniques
  • let hijacks block-scope -- differences between let and var is "block scope" and "hoisting"
  • let is cool, has some advantages, but is it really useful? Garbage collector? Security? "Hoisting" is important!
  • let-blocks are cool. Too bad they're not actually in JS. let-er is cool, but try/catch work-around is lame.
  • let is cool, but must be used with caution
  • Does let actually increase performance? let might be a bit more performant, due to stricter scope and better garbage collecting
  • Mozilla suggests "use let" with transpilers, even though let isn't supported yet.
  • let "is" hoisted? Just hoisted with a different value -- "undeclared" rather than the value you give it.
  • We like putting our variables at the top, so "hoisting" isn't that important.
  • Discussion of the eval statement -- if you use it, compiler doesn't optimize, your code will run slower
  • "Lexical" vs "Dyanmic" scope -- Lexical is at compile-time. Evail can trigger runtime-scope and drop var declarations at runtime
  • eval is useful for dynamic variable names.
  • eval at run-time polutes local scope. In strict mode, eval gets its own scope.
  • with is an interesting keyword and we've generally skipped it. Same with eval -- they're both "evil"
  • setTimeout has a string version!? It also works like eval!
  • IIFE Pattern -- we've seen it before, but patterns are cool! Passing window into IIFE and calling it global is neat.
  • Nice to have a name for IIFE!
  • People put undefined in function arguments to make sure undefined is undefined. In non-strict mode, someone can do undefined = true or some-such.
  • Name your functions! Don't use anonymous functions, they don't play well with a debugger. Even in a function expression, name them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment