Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var d = new Date();
- var currentYear = d.getFullYear();
- var year=Math.floor((Math.random() * 3000) + 1);
- if (year===currentYear){
- console.log("I'm in the present!");
- } else if(year > currentYear){
- console.log("Greeting from the future!");
- } else{
- console.log("Whoa!Blast from the past!");
- }
Add Comment
Please, Sign In to add comment