Search
 
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
Name
5+4 =