ALIEN SASQUATCH INVASION

ALIEN SASQUATCH INVASION

ALIEN SASQUATCH INVASION

ALIEN SASQUATCH INVASION

ALIEN SASQUATCH INVASION

ALIEN SASQUATCH INVASION

ALIEN SASQUATCH INVASION

ALIEN SASQUATCH INVASION

ALIEN SASQUATCH INVASION

ALIEN SASQUATCH INVASION

Waiting on password...

Console Commands

  • typeof : Used to determine the data type
  • let: is block scoped and can be updated but not re-declared
  • const: mantains constant values. They are block scoped and cannot be updated or redeclared
  • var: can be used inside/outside a block and have a scope of the enitre window. Can be updated or re-declared
  • alert() : Creates a notification in the top center of your screen
  • prompt() : Asks a question wit a provided response area that triggers an answer
  • console.log() : prints whatever is stated into the console
  • Data types

  • Numbers : Used for decimals and integers/floating point numbers
  • String : Sequence of characters used for text
  • Boolean : Logical type that can only be true or false
  • Undefined : Sets a value as a variable but is not yet defined. ex:(let milk;)
  • Number types

  • Null : both the value and type of value is (null)
  • Symbol : value that is unique and cannot be changed
  • BigInt : Larger integers than the Number type can hold
  • First Steps

    Comparison Operators

  • (==) : confirms if the input is only equal to the existing variable
  • (===) :confirms the input is of equal value and equal type to the variable
  • (=!) : confirms if the input is not equal to the variable
  • (==!) : confirms if the input is not of equal value or type to the variable
  • (**&) : multiplies the value by an exponential
  • (/) : gives you the value of the divided numbers
  • (%) : modulus remainder which gives you the value of the remainder of the division
  • (=<) : simple assignment operator which assigns a value to a variable
  • (=+/ =-<) : addition/subtraction assignment adds/subtracts a value to a variable
  • Logic Operators

  • And : (&&) No matter how many variables, the output will only be true when all values are true
  • Or : (||) The output is true even if only one variable is true
  • Not : (!x) inverts true/false
  • Operators

    Doohickeys?

  • ${...} : A template literal. Inserts variables directly into the string
  • Number : Will convert a value into a number value.
  • String : Will convert a value into a string value
  • Boolean values

  • False Values : Not false initially but are false when converted to a boolean
  • String : Converting an empty string into a boolean will display it as false.
  • String : Converting a complete string into a boolean will display it as true.
  • Number : a number with a value of 0 will be displayed as false or else in an (if/else) statement.
  • Number : a number with a value of ±1 will be displayed as true or if in an (if/else) statement.
  • Defined : if a variable has a valueable, it is defined. If it does not; undefined
  • Conditional Statements and Expressions

  • switch(letter){case1 "x": console.log(y); break; case2 "b"...default:}:
  • ^The switch statement is used to perform different actions based on different conditions.
  • Ternary Operator : a condition followed by a (?), then an expression to execute if the condition is truthy followed by (:),
  • and finally the expression to execute if the condition is falsy. and finally the expression to execute if the condition is falsy.
  • Values
    Statements
    Expressions

    Array Methods

  • Array literal : Literals represent values in JavaScript. These are fixed values —not variables— that you literally provide in your script
  • Array Indexes : Used to acces a specific array element using an index number
  • length : Returns the length (size) of an array
  • toString() : converts an array to a string of array values (comma seperated)
  • push() : adds elements to the end of an array
  • unshift() : adds elements to the end of an array
  • pop() : will remove the last element of an array
  • appendchild() : appends (adds) a node (element) as the last child of an elemnt
  • indexOf : returns the position of the first occurence of a value in a string, It will be returned as -1 if the value is not found, and is case sensitive
  • includes : will return true if the element is in the arrayt and false if is not
  • Objects

  • Objects : They are variables, but instead they can contain many values, the values are written as (name:value,) and is seperated by a colon
  • (object).(property) = Dot notation is explicit, can be sued to only acces propterties within This object
  • (object)['property'] = Bracket notation Can put any expression you'd like
  • This variable : equivalent to the object calling the method
  • Loops

  • for() : for loops keep running while the condition is TRUE
  • Continue : Used to exit the current iteration in a loop (if specific condition occurs) continue to the next one
    IN a while loop, the condition is tested, and if it's true, the loop will be executed again, In a for loop, the
    the increment expression is evalualted, and the condition is tested to find out if another iteration should be done
  • Methods Objects

    DOM

  • DOM : Document Object Model = Structered representation of HTML Documents.
    Allows JavaScript to access HTML elements and styles and manipulate them.
  • Selecting Elements

  • GetElementByID(' ') : Selects element by it's unique ID
  • GetElementByClassName(' ') : returns all elements of a class name in the order they appear in the document
  • GetElementByTagName(' ') : returns all elements of specified tag names in the order they appear in the document
  • querySelector(' ') : Selects the first item that matches the selector it's given
  • querySelectorAll(' ') : Selects all the items that match the selector it's given
  • createElement('') : creates an element in JS
  • Mouse Events

  • onmousedown = : actiates on the first stage of a mouse click on an element
  • onmouseup = : activates on the second stage of a mose cick and released oer the same element
  • onclick = : activates on the final(3rd) stage of a mouse click
  • onmouseover = : when the mouse is hovered over an element
  • onmouseout = : when the mouse hovers off of an element
  • onmouseenter = : when the pointer is moved into an element
  • onmouseleave = : when the pointer is moved out of an element
  • oncontextmenu = : activates when the users right clicks an element
  • Page Events

  • addEventListner() : this method allows you add a variety of events to the same element without overwriting ("click", "mouseover")
  • onload = : occurs when an object has been loaded
  • keydown : registers any keyboard press as a global input
  • onunload = : occurs when a page has been unloaded or is navigated away from. Also triggers when the page is reloaded (as well as the onload)
  • DOM Manipulation