#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...
- 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.
###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.