Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
/******
Rewrite the following if..else statement using the ternary operator:
----
let yearOfBirth = 2001
if (yearOfBirth <= 2002) {
  console.log('you will be old enough to vote in 2020')
} else {
  console.log('Sorry, you will not be old enough to vote next year')
}
---
******/
// Add your code below
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x