javascript-methods Flashcards
Why do we log things to the console?
To check what is going on
What is a method?
Performs actions on objects. It is a function on an object
How is a method different from any other function?
A method is associated with an object.
How do you remove the last element from an array?
pop() method
How do you round a number down to the nearest integer?
floor() method of the math object
How do you generate a random number?
Random () method of the math object
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?
They don’t and you can check the documentation. You cannot directly change a string. String methods just can bring up parts of a string but cannot change them. Use console.log
Roughly how many string methods are there according to the MDN Web docs?
50ish
Is the return value of a function or method useful in every situation?
No ; You don’t always need to use the return value.
Roughly how many array methods are there according to the MDN Web docs?
30ish
What three-letter acronym should you always include in your Google search about a JavaScript method or CSS property?
Mdn