From a1ec8beac15d336d0d05b6363c6e4f0bf35901c1 Mon Sep 17 00:00:00 2001 From: faizanalam11 <89991884+faizanalam11@users.noreply.github.com> Date: Thu, 22 Feb 2024 23:30:26 +0530 Subject: [PATCH] Update 01_javascript_refresher.md I was going through this articles to learn and at the same time i was running them too, at that moment of time i found some changes need to be done in the splice() section. --- 01_Day_JavaScript_Refresher/01_javascript_refresher.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/01_Day_JavaScript_Refresher/01_javascript_refresher.md b/01_Day_JavaScript_Refresher/01_javascript_refresher.md index 7d03fb4..ca25f18 100644 --- a/01_Day_JavaScript_Refresher/01_javascript_refresher.md +++ b/01_Day_JavaScript_Refresher/01_javascript_refresher.md @@ -799,7 +799,8 @@ console.log(numbers.splice(0, 1)) // remove the first item ```js const numbers = [1, 2, 3, 4, 5, 6] -console.log(numbers.splice(3, 3, 7, 8, 9)) // -> [1, 2, 3, 7, 8, 9] //it removes three item and replace three items +console.log(numbers.splice(3, 3, 7, 8, 9)) // -> [4, 5, 6] here it shows the removed items +console.log(numbers) // -> [1, 2, 3, 7, 8, 9] //it removes three item and replace three items ``` ##### Adding item to an array using push