wiki/content/20200826201029-arrays.md

30 lines
703 B
Markdown
Raw Permalink Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-30 17:34:11 +00:00
date: 2020-08-26
2024-05-06 20:40:05 +00:00
id: e7ed8c3a-ee07-4d46-ace9-f354ee4a47b2
title: JavaScript Arrays
---
- [Array Prototype
Methods](20201009090331-javascript_array_prototype_methods)
- [Array Functions](20201113103917-javascript_array_functions)
- [Destructuring Arrays](20201103111509-destructuring_arrays)
# Syntax
``` javascript
let listOfNumbers = [2, 3, 5, 7, 11];
console.log(listOfNumbers[2]); // 5
console.log(listOfNumbers[0]); // 2
```
# Type
In JavaScript arrays are a type of [object](20200826201605-objects) that
store sequences of things. `typeof` wil therefore return "object"
``` javascript
let listOfThings = ["Car", "Mr Magoo", 42];
console.log(typeof listOfThings); // object
```