From 6aa5dbfedbca2033f81ecb2ff40f0f5fb0a8e355 Mon Sep 17 00:00:00 2001 From: Boogloo <62970938+Boogloo@users.noreply.github.com> Date: Sat, 2 Apr 2022 21:56:21 -0400 Subject: [PATCH] Update Project_1.js Used splice() --- Chapter 03/Project_1.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Chapter 03/Project_1.js b/Chapter 03/Project_1.js index 20600fb..92ca924 100644 --- a/Chapter 03/Project_1.js +++ b/Chapter 03/Project_1.js @@ -1,7 +1,6 @@ theList.pop(); theList.shift(); theList.unshift("FIRST"); -theList[3] = "hello World"; -theList[2] = "MIDDLE"; -theList.push("LAST"); +theList.splice(2,5); +theList.splice(2, 3, "MIDDLE", "hello World", "LAST"); console.log(theList);