You can use if else statement to performe this :
var birthDay = Math.floor((Date.now() - @Date of Birth)/31536000000); @Date of Birth != null ? birthDay : null
But the problem with this calculation is the update not working every year if there is no changes in any field in the app !
you can use a related app with one date_Field witch you update manually and insert it in the calculation field...