Skip to content

First Submission - bare minimum tasks completed#426

Open
gittc100 wants to merge 2 commits into
bloominstituteoftechnology:masterfrom
gittc100:master
Open

First Submission - bare minimum tasks completed#426
gittc100 wants to merge 2 commits into
bloominstituteoftechnology:masterfrom
gittc100:master

Conversation

@gittc100

Copy link
Copy Markdown

No description provided.

@johnoro johnoro left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work!

Comment thread assignments/callbacks.js

getLength(items, function(x){
console.log(x);
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You reuse this callback throughout; it'd be easier to assign it to a variable and also reduce repetition:

// ...
const log = function(x){
  console.log(x);
}

getLength(items, log);
last(items, log);
// ...

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other thing to note here is that log is a function. Specifically, it's a method on the console object. You could instead pass it as your callback function since it's unnecessary to pass it via another function:

// ...
getLength(items, console.log);
last(items, console.log);
// ...

}));
console.log(arrObj1);

// Problem 2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a couple more problems and solve them! I'm assuming I just caught you when you weren't quite done here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants