var get_current_age = function(date) { return new Date().getFullYear() - date; }; alert(get_current_age(1986));