Javascript Syntax: Arrays Flashcards

1
Q

Property .length

A

The .length property of a JavaScript array indicates the number of elements the array contains.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Index

A

Array elements are arranged by index values, starting at 0 as the first element index. Elements can be accessed by their index using the array name, and the index surrounded by square brackets.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Method .push()

A

The .push() method of JavaScript arrays can be used to add one or more elements to the end of an array. .push() mutates the original array returns the new length of the array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Method .pop()

A

The .pop() method removes the last element from an array and returns that element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Mutable

A

JavaScript arrays are mutable, meaning that the values they contain can be changed.

Even if they are declared using const, the contents can be manipulated by reassigning internal values or using methods like .push() and .pop().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Arrays

A

Arrays are lists of ordered, stored data. They can hold items that are of any data type. Arrays are created by using square brackets, with individual elements separated by commas.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly