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
function calculateAge(birthyear, currentyear) { | |
var age = currentyear - birthyear; | |
document.write("You are either " + age + " or " + (age - 1)); | |
} | |
function calculateAge(birthyear){ | |
var d = new Date(); | |
var n= d.getFullYear(); | |
var age =n-birthyear; | |
document.write("You are either " + age + " or " + (age-1)); |