Skip to content

Conversation

@kevincchang13
Copy link

No description provided.


document.addEventListener("keyup", function(e) {
//I feel like this nested if statements can be condensed.
if (timerSpan.innerHTML > 29) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be a better way of tracking this. If I hit the space bar mutliple times before the time changes to 29, weird things might start happening. I would just keep a variable to tell if the game has started or not. I think I called it gameOn in my solution.

}
}
}
obj.person.sayHi.call(obj)
Copy link
Contributor

Choose a reason for hiding this comment

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

You can also do:

obj.person.sayHi = obj.person.sayHi.bind(obj);

var evens = []
arr.forEach(function(element) {
if (element % 2===0) {
evens.push(element)
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of pushing all of the evens into a new array, you could just do the sum here.


//Implement your own version of Function.prototype.bind

Function.prototype.bind = function(thisArg, ...outerArgs) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good

Copy link
Contributor

@tigarcia tigarcia left a comment

Choose a reason for hiding this comment

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

I didn't see the hacker snooze app. Did you forget to include it in the pull request?

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