Several conditions | var a = 1, b = 2, c = 3; if(a == 1) {if (b == 2) {if (c == 3) {} else {}} else {}} else {} | |
var a = 3, b = 2, c = 3; if(a == 1) {if (b == 2) {if (c == 3) {} else {}} else {}} else {} | |
var a = 3, b = 1, c = 2; if(a == 1) {if (b == 2) {if (c == 3) {} else {}} else {}} else {} | |
var a = 1, b = 2, c = 3; a == 1 ? b == 2 ? c == 3 ? 1 : 2 : 3 : 4 | |
var a = 3, b = 2, c = 3; a == 1 ? b == 2 ? c == 3 ? 1 : 2 : 3 : 4 | |
var a = 3, b = 1, c = 2; a == 1 ? b == 2 ? c == 3 ? 1 : 2 : 3 : 4 | |
var a = 3, b = 1, c = 2; if(a == 1 && b == 2 && c == 3){} | |
var a = 1, b = 2, c = 3; if(a == 1 && b == 2 && c == 3){} | |
var a = 3, b = 2, c = 3; if(a == 1 && b == 2 && c == 3){} | |
RegExp conditions | var a = 'abc'; if(/abc/.exec(a)[1]){} else {} | |
var a = 'abc'; if(a.match(/abc/)){} else {} | |
var a = 'abc'; if(a.search(/abc/) == -1){} else {} | |
var a = 'abc'; if(/abc/.test(a)){} else {} | |
var a = 'abc'; if(a.indexOf('abc') + 1){} else {} | |
var a = 'abc'; if(a.indexOf('abc') == -1){} else {} | |
var a = 'abc', h = {abc:1}; if(h[a]){} else {} | |
var a = 'abc'; if(a === 'abc'){} else {} | |