Created
October 13, 2010 13:05
-
-
Save mklabs/623995 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BONUS: what is the faulty logic in the following code? how would you fix it? | |
var date = new Date(), | |
day = date.getDate(), | |
month = date.getMonth(), | |
dates = []; | |
for (var i = 0; i <= 5; i++) { | |
dates.push(month + '/' + (day + i)); | |
} | |
console.log('The next five days are ', dates.join(', ')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment