From d9baaea4c2018a023ebe6580c90f65a6ec5164d0 Mon Sep 17 00:00:00 2001 From: Keivan Date: Tue, 1 Feb 2022 23:42:47 -0500 Subject: [PATCH] Fix: remove `[]` of the array in concat method This fixes the difference between commented results and the actual code --- javascript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript.md b/javascript.md index 377da0d..1ee92c8 100644 --- a/javascript.md +++ b/javascript.md @@ -574,7 +574,7 @@ const newFirstElement = 4 [newFirstElement].concat(array) // => [ 3, 2, 1, 4 ] -[array].concat(newFirstElement) +array.concat(newFirstElement) ``` if you want to avoid mutating your original array, you can use concat.