Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js if else statement one line

var time = Date().getHours(); // or something

var clockTime = time > 12 ? 'PM' : 'AM' ;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #statement #line
ADD COMMENT
Topic
Name
5+2 =