Skip to content
This repository was archived by the owner on Aug 31, 2019. It is now read-only.

Project W1(B) - Completed#38

Closed
Track7Dev wants to merge 8 commits into
bloominstituteoftechnology:masterfrom
Track7Dev:master
Closed

Project W1(B) - Completed#38
Track7Dev wants to merge 8 commits into
bloominstituteoftechnology:masterfrom
Track7Dev:master

Conversation

@Track7Dev

@Track7Dev Track7Dev commented Sep 7, 2017

Copy link
Copy Markdown

-Arrays: Completed
-Class: Completed
-Closure: Completed
-ES6: Completed
-Objects: Completed
-'This': Completed
-Recursion: Completed

Array Section Completed.
Extra Credit : In-Progress.
Array Section & Extra Credit Completed.
-Arrays: Completed
-Class: Completed
-Arrays: Completed
-Class: Completed
-Closure: Completed
-Arrays: Completed
-Class: Completed
-Closure: Completed
-ES6: Completed
-Arrays: Completed
-Class: Completed
-Closure: Completed
-ES6: Completed
-Objects: Completed
-Arrays: Completed
-Class: Completed
-Closure: Completed
-ES6: Completed
-Objects: Completed
-'This': Completed
-Arrays: Completed
-Class: Completed
-Closure: Completed
-ES6: Completed
-Objects: Completed
-'This': Completed
-Recursion: Completed
@Track7Dev Track7Dev changed the title Project W1(B) Project W1(B) - Completed Sep 9, 2017

@seanchen1991 seanchen1991 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice job on this assignment. I left a few comments on your syntax, but overall it's pretty good.

Comment thread src/arrays.js
// Iterates over a list of elements, yielding each in turn to the `cb` function.
// This only needs to work with arrays.
// based off http://underscorejs.org/#each
for (let i = 0; i < elements.length; i++) { cb(elements[i], i); }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For readability's sake, I would definitely move cb(elements[i], i); to its own line.

Comment thread src/arrays.js
// Produces a new array of values by mapping each value in list through a transformation function (iteratee).
// Return the new array.
const newArr = [];
for (let i = 0; i < elements.length; i++) { newArr.push(cb(elements[i])); }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same thing here.

Comment thread src/arrays.js
// Elements will be passed one by one into `cb`.
// `memo` is the starting value. If `memo` is undefined then make `elements[0]` the initial value.
// `memo` is the starting value. If `memo` is undefined then make `elements[0]` the initial value
if (memo === undefined) memo = elements[0];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here you can just do if (!memo)

Comment thread src/arrays.js
for (let i = 0; i < elements.length; i++) {
if (cb(elements[i])) return elements[i];
}
return undefined;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just to save yourselves a few keystrokes, you can just return; here, which is the same as doing return undefined;.

Comment thread src/class.js
this.password = options.password;
}
comparePasswords(pass) {
if (pass === this.password) return true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here you can just do return pass === this.password;

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants