Menu
I am trying to develop a simple script that will return the age of a certain person by subtraction their birth year from the current year, but i get a NaN error every time i run the script. My code is below:
var id
var bYear = new Array( 1989, 1991, 1995, 2000 );
var now = new Date();
var ynow = now.getYear();
var age = ynow – bYear[id];
id = prompt( “Find age of…”, “Enter ID No. Here” );
alert( age );