---
title: "Comment by John Dawson on \"How To Solve Coding Problems Like A Pro\" | Hashnode"
description: "That last example should use a ternary and proper English ;-) console.log((age &gt; = 18 ) ? `I am eligible to vote.` : `I am not eligible to vote because I am"
url: "https://hashnode.com/posts/how-to-solve-coding-problems-like-a-pro/6250702e75dccb6f3431c92d/comment/6258f7f02f84e0d4fc33a72d"
---

[Discussion](https://hashnode.com/posts/how-to-solve-coding-problems-like-a-pro/6250702e75dccb6f3431c92d)

Comment [How To Solve Coding Problems Like A Pro](https://hashnode.com/posts/how-to-solve-coding-problems-like-a-pro/6250702e75dccb6f3431c92d)

[John Dawson](https://hashnode.com/@JD-Boise)

[Apr 15, 2022](https://hashnode.com/posts/how-to-solve-coding-problems-like-a-pro/6250702e75dccb6f3431c92d/comment/6258f7f02f84e0d4fc33a72d)

That last example should use a ternary and proper English ;-)

```
console.log((age >= 18)
  ? `I am eligible to vote.`
  : `I am not eligible to vote because I am ${resultantYears} years under voting age.`
);
```

[The Revealer](https://hashnode.com/@therevealer)

[Apr 16, 2022](https://hashnode.com/posts/how-to-solve-coding-problems-like-a-pro/6250702e75dccb6f3431c92d/comment/6258f7f02f84e0d4fc33a72d#reply-625a16202f84e0d4fc33c4f1)

I'll note this.... will eventually make some changes. THANKS
