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';
}
Also in JavaScript:
- gi js
- js run html in blob
- redirect in react
- Material-ui Account Balance icon
- javascript add event listener to all input
- javascript array push object
- js extract all tags not have attr
- postasjsonasync not found
- how to get element by class name javascript
- hackerrank fizzbuzz javascript
- insert into array js
- javascript hover event
- reactjs TypeError: b is undefined
- array sorting javascript mergesort
- javascript object read only
- javascript function from string
- Regular expression: Match everything after a particular word
- manual avanzado java script
- json arrays
- javascript capitalize words
- return this javascript
- get height element use js
- react chart js 2 api data
- remove non prime numbers js