From 5b1ba73828de07c4677c12debf9013e28e41c4a7 Mon Sep 17 00:00:00 2001 From: Odi Abdulkareem Date: Wed, 28 Sep 2016 15:34:46 +0000 Subject: [PATCH 1/2] Done. --- .editorconfig | 0 .gitignore | 0 .learn | 0 CONTRIBUTING.md | 0 LICENSE.md | 0 README.md | 0 index.html | 0 index.js | 50 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 0 test/index-test.js | 0 test/mocha.opts | 0 test/root.js | 0 12 files changed, 50 insertions(+) mode change 100644 => 100755 .editorconfig mode change 100644 => 100755 .gitignore mode change 100644 => 100755 .learn mode change 100644 => 100755 CONTRIBUTING.md mode change 100644 => 100755 LICENSE.md mode change 100644 => 100755 README.md mode change 100644 => 100755 index.html mode change 100644 => 100755 index.js mode change 100644 => 100755 package.json mode change 100644 => 100755 test/index-test.js mode change 100644 => 100755 test/mocha.opts mode change 100644 => 100755 test/root.js diff --git a/.editorconfig b/.editorconfig old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.learn b/.learn old mode 100644 new mode 100755 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md old mode 100644 new mode 100755 diff --git a/LICENSE.md b/LICENSE.md old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/index.html b/index.html old mode 100644 new mode 100755 diff --git a/index.js b/index.js old mode 100644 new mode 100755 index 695b9e17a..ca43bff50 --- a/index.js +++ b/index.js @@ -1 +1,51 @@ const app = "I don't do much." + +var kittens = ["Milo", "Otis", "Garfield"]; +function Arrays() { + return kittens; +} + + +function kittens() { + var Kittens = ["Milo", "Otis", "Garfield"]; + return Kittens; +} + +function destructivelyAppendKitten(name) { + kittens.push(name); + return kittens; +} + +function destructivelyPrependKitten(name) { + kittens.unshift(name); + return kittens; +} + +function destructivelyRemoveLastKitten(name) { + kittens.pop(kittens.length-1); + return kittens; +} + +function destructivelyRemoveFirstKitten(){ + kittens.shift(); + return kittens; +} + +function appendKitten(name) { + return kittens; +} + +function prependKitten(name) { + kittens= [name,...kittens]; + return kittens; +} + +function removeLastKitten() { + kittens.pop(); + return kittens; +} + +function removeFirstKitten() { + kittens.shift(); + return kittens; +} diff --git a/package.json b/package.json old mode 100644 new mode 100755 diff --git a/test/index-test.js b/test/index-test.js old mode 100644 new mode 100755 diff --git a/test/mocha.opts b/test/mocha.opts old mode 100644 new mode 100755 diff --git a/test/root.js b/test/root.js old mode 100644 new mode 100755 From c90d2c920ed1648cc213a29da71e6f8c81d63acf Mon Sep 17 00:00:00 2001 From: Odi Abdulkareem Date: Mon, 3 Oct 2016 21:44:42 +0000 Subject: [PATCH 2/2] Done. --- index.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index ca43bff50..5b69699f5 100755 --- a/index.js +++ b/index.js @@ -32,20 +32,17 @@ function destructivelyRemoveFirstKitten(){ } function appendKitten(name) { - return kittens; +return [...kittens,name]; } function prependKitten(name) { - kittens= [name,...kittens]; - return kittens; + return [name,...kittens]; } function removeLastKitten() { - kittens.pop(); - return kittens; +return kittens.slice(0,2); } function removeFirstKitten() { - kittens.shift(); - return kittens; + return kittens.slice(1,3); }