Skip to content

Instantly share code, notes, and snippets.

@omarkdev
Created March 4, 2020 21:14
Show Gist options
  • Save omarkdev/9320de1f0e1c50f4ae29c159d560475d to your computer and use it in GitHub Desktop.
Save omarkdev/9320de1f0e1c50f4ae29c159d560475d to your computer and use it in GitHub Desktop.
const firstWay = !! 'works';
const secondWay = Boolean('works');
const thirdWay = new Boolean('works');
if (firstWay == true) {
console.log('First way really works!');
}
if (secondWay == true) {
console.log('Second way really works!');
}
if (thirdWay == true) {
console.log('Third way really works!');
}
// First way really works!
// Second way really works!
// Third way really works!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment