Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Animal category
//JavaScript-C24.2.0 (SpiderMonkey) var eatPlants=true ; // Could be true or false for a species of animals. var eatMeat=true ; // Could be true or false in a species of animals. var category = eatPlants===true && eatMeat === true ? ("Omnivores") : eatMeat===false && eatPlants === true ? ("Herbivores") : eatMeat==true && eatPlants==false ? ("Carnivores"):("Undefined"); print ( category )
run
|
edit
|
history
|
help
0
Variables
Wall
Palindrome
House prices
LearningJavaScript
Javascript Basics
Iterator()-function
JavaScript - CheckDate()
G
playing with undefined variables