Kurzschlussbewertung JavaScript

// short-circuit evaluation javascript
// Longhand method:
let variable1 = "something";
if (variable1 !== null || variable1 !== undefined || variable1 !== '') {
     let variable2 = variable1;
     console.log(variable2); // something
}

// Shorthand method:
let variable4 = null;
const variable3 = variable4  || 'new';
console.log(variable3); // new
Chetan Nada