JavaScript - Arrays Flashcards
What is an array?
An array is a data structure that stores a collection of items in a single variable.
What is a function?
Functions are blocks of code that help organise and reuse code efficiently. A function is a reusable piece of code that performs a specific task.
How many main array methods are there?
There are 4 Main Array Methods.
What are the names of the 4 Array Methods?
Pop, Push, Shift and Unshift.
What is an array method?
An array method is a function that is associated with an object or class in programming.
What does the push array method do?
The push method adds one or more elements to the end of an array.
What does the pop array method do?
The pop method removes the last element from an array and returns that element.
What does the push array method do?
The push method adds one or more elements to the end of an array.
What does the shift array method do?
The shift method removes the first element from an array and returns that element.
What does the unshift array method do?
The unshift method allows you to add one or more elements to the beginning of an array.
Which 2 Array Methods can you add/remove more than one of?
Push and Unshift