Javascript-Methods Flashcards
1
Q
Why do we log things to the console?
A
We log code to the console to double check that our outputs are what we expect them to be and to debug if problems occur.
2
Q
What is a method?
A
A method is a function that is a property of an object
3
Q
How is a method different from any other function?
A
It is called with the Object name.
4
Q
How do you remove the last element from an array?
A
The pop method
5
Q
How do you round a number down to the nearest integer?
A
Using the floor method of the Math object
6
Q
How do you delete an element from an array?
A
Using the pop and shift method
7
Q
How do you append an element to an array?
A