js es6 if one line code example
Example: js one line if
const condition = true;
// (condition) ? if : else
(condition) ? console.log("it is true") : console.log("it is false");
const condition = true;
// (condition) ? if : else
(condition) ? console.log("it is true") : console.log("it is false");