Boolean example

by Mukesh Yadav

JavaScript

let isVotingAllowed;
const age = prompt('Please enter your age.');
if (parseInt(age) >= 18){
	isVotingAllowed = true;
}else{
	isVotingAllowed = false;
}

console.log('isVotingAllowed: ', isVotingAllowed);