DEV Community

Discussion on: Guard Clauses: How to clean up Conditionals

Collapse
 
ombratteng profile image
Ole-Martin Bratteng • Edited
//a variable to test with
let a = 'a';

//condition && result
// !! THIS WILL WORK !!
a === 'a' && (
  console.log('did this work?'),
  console.log('yes :)')
);
Enter fullscreen mode Exit fullscreen mode

replit.com/@omBratteng/guard-claus...