Instead of using an if-condition, you can use a logical AND/OR. This can be used within a function for executing commands.
const input = 2
input === 5 && console.log("it si 5")
input === 5 || console.log("it is not 5")
Instead of using an if-condition, you can use a logical AND/OR. This can be used within a function for executing commands.
const input = 2
input === 5 && console.log("it si 5")
input === 5 || console.log("it is not 5")