Skip to content

Instantly share code, notes, and snippets.

@joshuajhun
Created February 1, 2016 06:08
Show Gist options
  • Save joshuajhun/00003351166caf3295a1 to your computer and use it in GitHub Desktop.
Save joshuajhun/00003351166caf3295a1 to your computer and use it in GitHub Desktop.
Speaking JavaScript

#Chapter 3

  • it's dynamic!
    • you can change things directly and don't need to create a factory ( a class)
  • dynamically typed
    • variables can hold any type of value
  • Functional / object oriented
    • it can do both!
  • Fails silently
  • It's deployed as source code
    • it can compress and minify your code!
  • It's part of the web platform
    • it's like in every single part of the web...

probs

  • Arguably, arrays in JavaScript are too flexible: they are not indexed sequences of elements, but maps from numbers to elements. Such maps can have holes: indices “inside” the array that have no associated value. Again, engines help by using an optimized representation if an array does not have holes.

Chapter 15

###parameters vs arguments

  • parameters are typically used to define funtions. function foo(params1, params2){}
  • Arguements invoke funtions foo(3, 7)
  • all functions are arguments
  • functions expression return values and in some cases that value is an actual object.
  • You can give a function expression a name. Named function expressions allow a function expression to refer to itself, which is useful for self-recursion:
  • In other words, a function declaration declares a new variable, creates a function object, and assigns it to the variable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment