Codecademy JS Basics - Arrays

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Array Functions

push() - adds items to the array slice() - returns a segment of the array length() - returns the length of the array shift() - removes the first element in an array indexOf() - returns the index of a given value pop() - removes the last element from an array unshift() - adds an element to the beginning of an array, requires an argument

Elements in an array

- Arrays in JavaScript are zero-indexed, meaning the positions start counting from 0 rather than 1 - elements can be called using the following notation: arrayName[0]; - Elements can be adjusted outside the array

Arrays

-way of making lists. -Arrays can store any data types (including strings, numbers, and booleans). -arrays are ordered, meaning each item has a numbered position. -declared like any other variable in JS


Ensembles d'études connexes

MBUS300 - Final Exam (Financial Chapters 1-3, Management 1-3)

View Set

CH 9 : MUSCLES AND MUSCLE TISSUSES, FINAL REVIEW

View Set

B1 - frases para completar con pronombres de OI y OD

View Set