# Complex conditions in shortened form in JavaScript

In shortened form, you can use the operators `&&` and `||`. See an example:

`let test1 = true; let test2 = true; if (test1 && test2) { console.log('+++'); } else { console.log('---'); }`

Another example:

`let test1 = true; let test2 = true; if (test1 || test2) { console.log('+++'); } else { console.log('---'); }`

Rewrite the following code in shortened form:

`let test1 = true; let test2 = true; if (test1 === true && test2 === true) { console.log('+++'); } else { console.log('---'); }`

Rewrite the following code in shortened form:

`let test1 = true; let test2 = true; if (test1 === true && test2 !== true) { console.log('+++'); } else { console.log('---'); }`

Rewrite the following code in shortened form:

`let test1 = true; let test2 = true; if (test1 !== true && test2 !== true) { console.log('+++'); } else { console.log('---'); }`

Rewrite the following code in shortened form:

`let test1 = true; let test2 = true; if (test1 !== false && test2 === true) { console.log('+++'); } else { console.log('---'); }`

Rewrite the following code in shortened form:

`let test1 = true; let test2 = true; let test3 = true; if (test1 === true && test2 === true && test3 === true) { console.log('+++'); } else { console.log('---'); }`

Rewrite the following code in shortened form:

`let test1 = true; let test2 = true; let test3 = true; if (test1 === true || test2 === true && test3 === true) { console.log('+++'); } else { console.log('---'); }`

Rewrite the following code in shortened form:

`let test1 = true; let test2 = true; let test3 = true; if (test1 === true || test2 === false && test3 === false) { console.log('+++'); } else { console.log('---'); }`
← →
↑
en ru