We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f7266b1 commit 75f5b8aCopy full SHA for 75f5b8a
1-js/05-data-types/04-array/article.md
@@ -100,9 +100,9 @@ Let's say we want a last element of the array.
100
101
Some programming languages allow to use negative indexes for the same purpose, like `fruits[-1]`.
102
103
-Although, in JavaScript it won't work. The result will be `undefined`.
+Although, in JavaScript it won't work. The result will be `undefined`, because the index in square brackets is treated literally.
104
105
-We can explicitly calculate the last element index and then access it, using `fruits[fruits.length - 1]`:
+We can explicitly calculate the last element index and then access it: `fruits[fruits.length - 1]`.
106
107
```js run
108
let fruits = ["Apple", "Orange", "Plum"];
0 commit comments