Toggle navigation
Genres
Frontend (2)
JavaScript (6)
Database (2)
Linux Server (3)
Web Apps (4)
Misc (4)
Search
List
New Tutorials
Last Modified Tutorials
</>
Code examples
code
smiko
javascript
basic
042bool_conditional_operator.js
042bool_conditional_operator.js
/** * Conditional operator ? */ var now = new Date(); var greeting = "Good" + ((now.getHours() > 17) ? " evening." : " day."); console.log(now.getHours()); console.log(greeting);
Reload page
Preview
W3C validation
Edit Code
JS Console