Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

question mark in javascript

boolean statement ? true result : false result;

/*
For example, if we take this if statement:
*/
if (a > b) {
    result = x;
} else {
    result = y;
}
// can be also writen:
result = a > b ? x : y;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #question #mark #javascript
ADD COMMENT
Topic
Name
4+9 =