Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"standard.enable": false
"standard.enable": false,
"liveServer.settings.port": 5501
}
14 changes: 8 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
*
Expand All @@ -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]);
}

/**
Expand All @@ -88,8 +90,8 @@ function processLastItem(/* CODE HERE */) {
* [2] Invoking `processSum` passing `-5`, '-1', and `(num) => num + 1000`,
* should return 994.
*/
function processSum(/* CODE HERE */) {
/* CODE HERE */
function processSum(num1,num2,cb{

}

/**
Expand Down