Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

ternary

;var eatsPlants = false
;var eatsAnimals = true
;var category = eatsPlants? (eatsAnimals? "omnivore" : "herbivore" ) : (eatsAnimals? "carnivore" : "undefined")

;console.log(category)
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #ternary
ADD COMMENT
Topic
Name
1+7 =