From 75f5b8af1454efdd1a8eb57ce00fcd78b03da08f Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Fri, 15 Apr 2022 13:46:09 +0300 Subject: [PATCH] minor fixes --- 1-js/05-data-types/04-array/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/05-data-types/04-array/article.md b/1-js/05-data-types/04-array/article.md index 2d03404f..95a78f29 100644 --- a/1-js/05-data-types/04-array/article.md +++ b/1-js/05-data-types/04-array/article.md @@ -100,9 +100,9 @@ Let's say we want a last element of the array. Some programming languages allow to use negative indexes for the same purpose, like `fruits[-1]`. -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. -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]`. ```js run let fruits = ["Apple", "Orange", "Plum"];