DEV Community

Mohamed Idris
Mohamed Idris

Posted on

What is the output of the following JavaScript code snippet? (|| and && example)

const x = '';
console.log(x || 'Default');
console.log(x && 'Default');
Enter fullscreen mode Exit fullscreen mode

Credits: John Smilga's react course

Top comments (0)