👾 Update summary section

This commit is contained in:
Lavrentiy Rubtsov 2022-05-09 08:31:22 +06:00 committed by GitHub
parent 206485fc3a
commit 598ca68f21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -512,7 +512,7 @@ That's simple: don't use the `==` operator. Instead, compare them item-by-item i
Array is a special kind of object, suited to storing and managing ordered data items. Array is a special kind of object, suited to storing and managing ordered data items.
- The declaration: The declaration:
```js ```js
// square brackets (usual) // square brackets (usual)
@ -527,6 +527,11 @@ Array is a special kind of object, suited to storing and managing ordered data i
- The `length` property is the array length or, to be precise, its last numeric index plus one. It is auto-adjusted by array methods. - The `length` property is the array length or, to be precise, its last numeric index plus one. It is auto-adjusted by array methods.
- If we shorten `length` manually, the array is truncated. - If we shorten `length` manually, the array is truncated.
Getting the elements:
- we can get element by its index, like `arr[0]`
- also we can use `at(i)` method to get negative-index elements, for negative values of `i`, it steps back from the end of the array. In the rest it works same as `arr[i]`, if `i >= 0`.
We can use an array as a deque with the following operations: We can use an array as a deque with the following operations:
- `push(...items)` adds `items` to the end. - `push(...items)` adds `items` to the end.