Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

expresiones ternarias javascript

var condition = false;
var result1 = "First result";
var result2 = "Second result";
var result = condition ? result1 : result2;
//result1 will be assigned to result if condition is true.
//If not, result2 will be assigned
 
PREVIOUS NEXT
Tagged: #expresiones #ternarias #javascript
ADD COMMENT
Topic
Name
5+4 =