JavaScript Methods Flashcards
Why do we log things to the console?
To test and debug the code we are working on
What is a method?
It is a function that is a property of an object
How is a method different from any other function?
Methods are used to called on objects
How do you remove the last element from an array?
Using the pop() method
How do you round a number down to the nearest integer?
Using the Math.floor() method
How do you delete an element from an array?
Using the splice() method
How do you append an element to an array?
Using the push() method
How do you break a string up into an array?
Using the split() method on the string
Do string methods change the original string? How do you check if you weren’t sure?
No, it does not affect the original string, you can check by using the console.log on the original string
Roughly how many string methods are there according to the MDN web docs?
Roughly about 36 to 40 methods
Is the return value of an function or method useful in every situation?
No, not every return value will be used in every situation
Roughly how many array methods are there according to the MDN web docs?
Roughly about 36 to 40 methods
What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?
The MDN web docs