js/app.js
/* The function checks validates the age provided by user */
The function checks validates the age provided by user
The function checks validates the age provided by user
function checkage(age) {
	var correctage = '50';
	if (age === null) {
		alert('No User Input. Thanking for Playing')
	}
	else if (age > 50) {
		alert('Try lesser number')
		verifyage();
	}
	else if (age < 50) {
		alert('Try higher number')
		verifyage();
	}
	else if (age === correctage) {
		alert('Congratulations!! ' + age + ' is correct answer.');
		correctflag = 'Y';
	}
	else {
		alert('Ops!! ' + age + ' is incorrect answer.Please try the game again');
	}	
}
function checkage ( age ) { var correctage = '50' ; if ( age === null ) { alert ( 'No User Input. Thanking for Playing' ) } else if ( age > 50 ) { alert ( 'Try lesser number' ) verifyage ( ) ; } else if ( age < 50 ) { alert ( 'Try higher number' ) verifyage ( ) ; } else if ( age === correctage ) { alert ( 'Congratulations!! ' + age + ' is correct answer.' ) ; correctflag = 'Y' ; } else { alert ( 'Ops!! ' + age + ' is incorrect answer.Please try the game again' ) ; } }
The function checks validates the age provided by user
The function checks validates the age provided by user