DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
Use multiple conditional operators in the checkSign function to check if a number is positive, negative or zero. The function should return "positive", "negative" or "zero".
function checkSign(num) { return (num > 0) ? 'positive' : (num < 0) ? 'negative' : 'zero'; }
PREVIOUS
NEXT
Tagged:
#Use
#multiple
#conditional
#operators
#checkSign
#function
#check
#number
#negative
#The
#function
#return
ADD COMMENT
Topic
COMMENT
Name
6+3 =
Submit