-
Notifications
You must be signed in to change notification settings - Fork 83
finished testing exercises in testing.js and testingSpec.js #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…nt could be done better.
|
|
||
| document.addEventListener("keyup", function(e) { | ||
| //I feel like this nested if statements can be condensed. | ||
| if (timerSpan.innerHTML > 29) { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
There was a problem hiding this 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?
No description provided.