From f185a793a359bad3f69c0d6f7354dbac9109ab87 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Wed, 8 Jul 2020 09:19:26 +0300 Subject: [PATCH] Update last.md --- snippets/last.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/snippets/last.md b/snippets/last.md index d1babd375..efc48c99a 100644 --- a/snippets/last.md +++ b/snippets/last.md @@ -8,8 +8,7 @@ Returns the last element in an array. Check if `arr` is an instance of an `Array`, use `arr.length - 1` to compute the index of the last element of the given array and return it, otherwise return `undefined`. ```js -const last = arr => - (arr instanceof Array ? arr[arr.length - 1] : undefined); +const last = arr => (arr instanceof Array ? arr[arr.length - 1] : undefined); ``` ```js