javascript-methods Flashcards
Why do we log things to the console?
console.log() is a powerful tool for debugging and an easy way to inspect your variables in the browser.
What is a method?
A method is a function which is a property of an object.
How is a method different from any other function?
In JavaScript functions themselves are objects, so, in that context, a method is actually an object reference to a function.
How do you remove the last element from an array?
pop
How do you round a number down to the nearest integer?
floor
How do you generate a random number?
random
How do you delete an element from an array?
splice
How do you append an element to an array?
unshift
How do you break a string up into an array?
split
Do string methods change the original string? How would you check if you weren’t sure?
No
Roughly how many string methods are there according to the MDN Web docs?
35?
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?
37
What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?
MDN