Complex CSS Selectors
CSS selectors identifies an HTML element based on its type(either class, id, or generality)
Other notable methods is document.createElement("")that will create HTML elements.
.appendChild("") allows you to add child HTML elements to a selected HTML parent.
Function Declarations are nonanonymous. They are named functions that loook like:.
Notice that the name is not set in a variable. This allows for hoisting, the ability to call the function above where it was first placed. At DBC, the teachers opinionate that we shouldn't use Declarations because of this effect.
Function Expressions are anonymous functions. The functions are not named themselves, but are called by setting a variable to them. They do not have the hoisting effect and look like the image below:
First Class Objects/Callbacks
If we were to set variables within Functions, the variables will 'drip' down into w/e other nested functions that are within the parent function. If we were to set various variables in every function layer and set access the variables at the innermost function, we would only be able to call this function if we have the right number of parameters() as we call it.This is a Closure. This protected effect occurs because the return of each function layer aside from the closure will give the nested function, not anything else.
Object Literals look like this:
Constructors look like this: