Javascript quick study Flashcards
1
Q
remove from front
A
array.shift()
leave () blank
2
Q
remove from back
A
array.pop()
leave () blank
3
Q
add to front
A
array.unshift(new element)
4
Q
add to back
A
array.push(new element)
5
Q
absolute value
A
Math.abs(number) //always positive
6
Q
round up
A
Math.ceil(number)
7
Q
round down
A
Math.floor(number)
8
Q
Generate random number
A
Math.random() * (max - min) + min)
leave () blank
9
Q
Not
A
!
10
Q
Or
A
||
11
Q
And
A
&&
12
Q
Equal to
A
===
13
Q
Not equal to
A
!==
14
Q
Get character in a string
A
“string”[index]
15
Q
Get length
A
.length