javascript-methods Flashcards
Why do we log things to the console?
For debugging.
What is a method?
Methods are functions, which are properties of an object.
How is a method different from any other function?
Methods are built within 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 round ( ) method of the Math object.
How do you generate a random number?
Using the random ( ) method of the Math object.
How do you delete an element from an array?
Using either the splice( ) or pop( ) method.
How do you append an element to an array?
Using either push ( ) method.
How do you break a string up into an array?
Using the split ( ) method.
Do string methods change the original string? How would you check if you weren’t sure?
No, using console.log( ).
Roughly how many string methods are there according to the MDN Web docs?
Around 40 methods.
Is the return value of a function or method useful in every situation?
No.
Roughly how many array methods are there according to the MDN Web docs?
Around 30 methods.
What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?
MDN.