Skip to content

Instantly share code, notes, and snippets.

View poornachandratejasvi's full-sized avatar

poornachandratejasvi

  • Mysore,Karnataka,India
View GitHub Profile
@poornachandratejasvi
poornachandratejasvi / 1.js
Last active February 23, 2017 07:45
wiredelta answers
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));