JavaScriptA person can Vote or not using JavaScript February 19, 2023 - by Prajwal Rai - Leave a Comment <script> function canVote(age) { if (age >= 18) { return " Eligible to vote. " ; } else { return " Not eligible to vote. " ; } } let age = prompt( " Enter your age: " ); let result = canVote(age); alert(result); </script>