Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

ternary else

a ? b : b ? c : d


// Eg

function scale (x) {
  return (x > 0) ? "positive"
  : (x < 0) ? "negative"
  : true
};
scale(3) //"positive"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #ternary
ADD COMMENT
Topic
Name
6+1 =