Javascript Flashcards
What are the 6 types of values in JavaScript?
Numbers, Strings, Booleans, Objects, Functions, Undefined
What type of operator is this: =
Assignment operator, Assigns value to a variable
What type of operator is this: +
Addition operator, adds values
What type of operator is this: -
Subtraction operator, subtracts values
What type of operator is this: /
Division operator, divides values
What type of operator is this: %
Remainder operator, divides values and gives back the remainder.
Example: 27 % 16 = 11. Because 27 / 16 = 1 with a remainder of 11.
What type of operator is this: ++
Increment operator, adds 1 to its operant and returns the value
What operator is this: –
Decrement operator, subtracts 1 from its operant and returns the value
What is an operand?
An operand is a value that is being acted upon by an operator
String
Used to represent text. Written in quote marks.
Ex: “This is a string”
\ ~In the context of a string~
Escaping. This signifies in a string that the next character is important.
Ex: “This is a "quote"”
Result: This is a “quote”
\n
New line
Ex: “Hello Top \nHello Bottom”
Result: Hello Top
Hello Bottom
\t
Tab in a string.
\
Backslash in a string
"
Quote marks in a string.