Multiple Condition Checks

PHOTO EMBED

Mon Apr 26 2021 09:59:08 GMT+0000 (Coordinated Universal Time)

Saved by @Pepe #javascript

if (res === 25 || res === "twenty-five" || res === 25.0) {
  // some action here
}

// Shorthand
if ([25, "twenty-five", 25.0].includes(res)) {
  // some action here
}
content_copyCOPY

https://javascript.plainenglish.io/30-awesome-javascript-shorthand-techniques-that-are-good-to-know-6590545ced3d