diff --git a/index.js b/index.js index 132693a35c..cf5b4db012 100644 --- a/index.js +++ b/index.js @@ -1 +1,36 @@ // Write your solution here! + +const cats = ['Milo', 'Otis', 'Garfield']; + +function destructivelyAppendCat() { + cats.push('Ralph'); +}; + +function destructivelyPrependCat() { + cats.unshift('Bob'); +}; + +function destructivelyRemoveLastCat() { + cats.pop(); +}; + +function destructivelyRemoveFirstCat() { + cats.shift(); +}; + +function appendCat() { + return appendCat = [...cats, 'Broom']; +}; + +function prependCat() { + return prependCat = ['Arnold', ...cats]; +}; + +function removeLastCat() { + return removeLastCat = [...cats.slice(0,-1)]; +}; + +function removeFirstCat() { + return removeFirstCat = [...cats.slice(1)]; +}; +