javascript-01 Flashcards
(41 cards)
variable data types
number, string, boolean, null, object
number
any numeric value
string
any string of alphanumeric characters
Boolean
True or flase values only
null
special keyword for the null value
object
a reference to a JavaScript object
literals
Actual data values you provide to JavaScript
- integer literal
- floating-point literal
- string literal
Rules for naming variables
- Names can contain letters, digits, underscores, and dollar signs.
- Names must begin with a letter
- Names can also begin with $ and _
How to declare a variable
by using the var keyword
javaScript is case sensitive, true or false?
true
what are the JavaScript Expressions
Assignment, Arithmetic, String, logical
Assignment
assigns a value to a variable
what is arithmetic expression
evaluates to a number
What is the String expression
evaluates to a string
what is the logical expression
evaluates to true or false
what are operators
used in expressions to store or return a value
=
assigns the value of the right operand to the left operand
+=
add together the operands and assigns the result to the left operand
-=
subtracts the right operand from the left operand and assigns the result to the left operand
*=
multiplies the operands and assigns the result to the left operand
/=
divides the left operand by the right operand and assigns the result to the left operand
%=
divides the left operand by the right operand and assigns the remainder to the left operand
+
adds the operands together
-
substracts the right operand from the left operand