| description |
Condition |
| keywords |
js, condition |
| title |
JavaScript condition |
| toc_max |
4 |
- if
- else
- else if
- tenary condition
if (condition_here){
//statement
}
if (condition_here){
//statement
}else{
// statement
}
if (condition_here){
//statement
}else if (condition_here) {
// statement
}else if (condition_here) {
// statement
}else if (condition_here) {
// statement
}else {
// statement
}
condition ? trueValue : falseValue
let product = 'and';
switch(product) {
case 'web':
console.log('web product');
break;
case 'android':
case 'and':
console.log('android development');
break;
default:
console.log('I am default');
}