We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e66a501 commit 2839cc8Copy full SHA for 2839cc8
index.js
@@ -1 +1,34 @@
1
-// Write your solution here!
+const cats = ["Milo", "Otis", "Garfield"];
2
+
3
+function destructivelyAppendCat(Ralph){
4
+ return cats.push(Ralph);
5
+}
6
7
+function destructivelyPrependCat(Bob){
8
+return cats.unshift(Bob);
9
10
11
+function destructivelyRemoveLastCat(Garfield){
12
+ return cats.pop(Garfield);
13
14
15
+function destructivelyRemoveFirstCat(Milo){
16
+ return cats.shift(Milo);
17
18
19
+function appendCat(Broom){
20
+ return [...cats, Broom];
21
22
23
+function prependCat(Arnold){
24
+ return [Arnold, ...cats];
25
26
27
+function removeFirstCat(){
28
+ return cats.slice(1);
29
30
31
+function removeLastCat(){
32
+ return cats.slice(0,2);
33
34
0 commit comments