<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: BELLO ABD'QUADRI BOLAJI</title>
    <description>The latest articles on DEV Community by BELLO ABD'QUADRI BOLAJI (@diamond_worlldd).</description>
    <link>https://dev.to/diamond_worlldd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3896834%2F7ba1f5c4-9266-4fc6-9652-8043751dae83.jpg</url>
      <title>DEV Community: BELLO ABD'QUADRI BOLAJI</title>
      <link>https://dev.to/diamond_worlldd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/diamond_worlldd"/>
    <language>en</language>
    <item>
      <title>How To Build A Simple Voting Eligibility Age Checker With JavaScript</title>
      <dc:creator>BELLO ABD'QUADRI BOLAJI</dc:creator>
      <pubDate>Sat, 25 Apr 2026 02:29:27 +0000</pubDate>
      <link>https://dev.to/diamond_worlldd/how-to-build-a-simple-voting-eligibility-age-checker-with-javascript-3g7a</link>
      <guid>https://dev.to/diamond_worlldd/how-to-build-a-simple-voting-eligibility-age-checker-with-javascript-3g7a</guid>
      <description>&lt;p&gt;I'm a CS student currently documenting my learning journey. If you found this helpful or have a suggestion on how to improve the code, let me know!!!&lt;/p&gt;

&lt;p&gt;Checking for eligibility is one of the first things we learn in programming as a student. Whether it is for a voting system, a driver's license app, or a simple age gate, the logic is the same.&lt;br&gt;&lt;br&gt;
In this tutorial of mine, I’ll show you how to build a basic Voters Eligibility Age Checker using JavaScript with if/else statements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Requirement&lt;/strong&gt; &lt;br&gt;
To follow along, you just need:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A basic text editor (like VS Code or even Notepad).&lt;/li&gt;
&lt;li&gt;A web browser (to run the code in the Console).
The Logic: How it Works
Before we code, let's look at the &lt;strong&gt;Plain English Logic&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We ask the user for their age.&lt;br&gt;
If the age is 18 or older, they can vote.&lt;br&gt;&lt;br&gt;
Else (if they are younger than 18), they are not eligible yet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Java Script Code:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;'''javascript&lt;br&gt;
let ageInput = prompt("Please enter your age to check your voting eligibility:");&lt;/p&gt;

&lt;p&gt;let userAge = Number(ageInput);&lt;/p&gt;

&lt;p&gt;if (isNaN(userAge)) {&lt;br&gt;
    console.log("Error: Please enter a valid number for your age. ⚠️");&lt;br&gt;
} else if (userAge &amp;gt;= 18) {&lt;br&gt;
    console.log("You are " + userAge + " years old. You're eligible to vote! ✅");&lt;br&gt;
} else {&lt;br&gt;
    console.log("You are " + userAge + " years old. You aren't eligible to vote yet. ❌");&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;My Challenge:&lt;br&gt;
Can you modify this code to tell the user exactly how many years they need to wait if they aren't 18 yet? &lt;br&gt;
Post your solution in the comments!!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
