From 08432f3035b637b02384f20e02010b5b97221399 Mon Sep 17 00:00:00 2001 From: Resiid <60631565+Resiid@users.noreply.github.com> Date: Sat, 14 Mar 2020 12:26:24 -0500 Subject: [PATCH 1/2] 2 q's done --- .vscode/settings.json | 3 ++- index.js | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 95b2d6470..bd2c1a2f5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "standard.enable": false + "standard.enable": false, + "liveServer.settings.port": 5501 } \ No newline at end of file diff --git a/index.js b/index.js index f61169392..8bdd5521e 100644 --- a/index.js +++ b/index.js @@ -48,10 +48,12 @@ function processFirstItem(stringList, callback) { * [2] Invoking `processLength` passing `[]` and `(num) => "There are " + num`, * should return "There are 0". */ -function processLength(/* CODE HERE */) { - /* CODE HERE */ +function processLength(list,cb) { +return cb(list.length); } + + /** * ### Challenge `processLastItem` * @@ -66,8 +68,8 @@ function processLength(/* CODE HERE */) { * Invoking `processLastItem` passing `['foo', 'bar']` and `(str) => str + str`, * should return 'barbar'. */ -function processLastItem(/* CODE HERE */) { - /* CODE HERE */ +function processLastItem(stringlist,cb) { + return cb(stringlist[stringlist.length-1]); } /** From 8712fb35eedc34f0e414c5ee055fefe268bc91bd Mon Sep 17 00:00:00 2001 From: Resiid <60631565+Resiid@users.noreply.github.com> Date: Sat, 14 Mar 2020 13:21:22 -0500 Subject: [PATCH 2/2] sumof --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 8bdd5521e..a7cf4d949 100644 --- a/index.js +++ b/index.js @@ -90,8 +90,8 @@ function processLastItem(stringlist,cb) { * [2] Invoking `processSum` passing `-5`, '-1', and `(num) => num + 1000`, * should return 994. */ -function processSum(/* CODE HERE */) { - /* CODE HERE */ +function processSum(num1,num2,cb{ + } /**