DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
ternary operator return date greeting
var now = new Date(); var greeting = "Good" + ((now.getHours() > 17) ? " evening." : " day.");
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#ternary
#operator
#return
#date
#greeting
ADD COMMENT
Topic
COMMENT
Name
5+4 =
Submit