javascript-methods Flashcards
Why do we log things to the console?
to debug and check data
What is a method?
a function that is a property of an object
How is a method different from any other function?
they belong to a property of that object
How do you remove the last element from an array?
pop method removes the last element on an array
How do you round a number down to the nearest integer?
round method will round down
How do you generate a random number?
the random method
How do you delete an element from an array?
splice method
How do you append an element to an array?
push method
How do you break a string up into an array?
split method
Do string methods change the original string? How would you check if you weren’t sure?
no and you would console.log
Roughly how many string methods are there according to the MDN Web docs?
it roughly 40s
Is the return value of a function or method useful in every situation?
no - because not all functions are meant to return
Roughly how many array methods are there according to the MDN Web docs?
a lot more than 30
What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?
MDN