Javascript Methods Flashcards
Why do we log things to the console ?
Debugging and inspecting variables in the browser
What is a method ?
Functions stored as object properties
How is a method different from any other function ?
It is an object property that has a function value
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 ?
splice()
How do you append an element to an array ?
push()
How do you break a string up into an array ?
split()
Do string methods change the original string? How would you check ?
No they don’t. You can check by calling the variable in the console
Roughly how many string methods exist?
52
Is the return value of a function method useful in every situation ?
Not in every situation
Roughly how many array methods are there ?
45
What three-letter acronym should you always include in your google searches about a Javascript or CSS property ?
MDN