Javascript methods Flashcards
Why do we log things to the console?
console.log
What is a method?
actions performed on objects
How is a method different from any other function?
its attached to an object
How do you remove the last element from an array?
.pop()
How do you round a number down to the nearest integer?
math.round()
How do you generate a random number?
math.random()
How do you delete an element from an array?
.shift()
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.
console.log(‘string’)
Roughly how many string methods are there according to the MDN Web docs?
50
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?
40-50
What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?