Last active
March 16, 2016 01:17
-
-
Save christiearcus/19e857488b627d2836f7 to your computer and use it in GitHub Desktop.
Date Method
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
// https://gist.github.com/epoch/309e4a021cd06f8ae32b#file-js-day2-else-if-md | |
console.log('date.js is alive'); | |
var n = new Date(); | |
var year = n.getFullYear(); | |
if (year === 2015) { | |
console.log('Im in the present'); | |
} | |
else if (year < 2015) { | |
console.log('Whoa! Blast from the past!'); | |
} | |
else if (year > 2015) { | |
console.log('Greetings from the future!'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment