diff --git a/index.js b/index.js index 132693a35c..2985b31af8 100644 --- a/index.js +++ b/index.js @@ -1 +1,27 @@ // Write your solution here! +let cats = ["Milo", "Otis", "Garfield"]; + +function destructivelyAppendCat(name) { + return cats.push(name) +} + +function destructivelyPrependCat(name) { + return cats.unshift(name) +} + +function destructivelyRemoveLastCat(name) { + return cats.pop(name) +} + +function destructivelyRemoveFirstCat(name) { + return cats.shift(name) +} +function appendCat(name) { + return cats.concat(name) +} + +function prependCat(name) { + return [name, ...cats]; +} + +console.log(prependCat("Arnold")) \ No newline at end of file