JS Methods Flashcards
1
Q
Why do we log things to the console?
A
to check for bugs
2
Q
What is a method?
A
function which is a property of an object.
3
Q
How is a method different from any other function?
A
The difference is that a method is associated with an object, while a function is not.
4
Q
How do you remove the last element from an array?
A
pop()
5
Q
How do you round a number down to the nearest integer?
A
math.round()
6
Q
How do you generate a random number?
A
math.random()
7
Q
How do you delete an element from an array?
A
shift()
8
Q
How do you append an element to an array?
A
unshift()
9
Q
How do you break a string up into an array?
A
split()
10
Q
What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?
A
MDN