DEV Community

Sh Raj
Sh Raj

Posted on

🎩 JavaScript Magic: 20 Quirky Questions! πŸ’«

JavaScript Magic: 20 Quirky Quandaries! πŸ’«

Prepare to be enchanted by the mysterious world of JavaScript quirks! πŸ§™β€β™‚οΈ Let's embark on a journey through 20 mind-bending questions that will test your understanding of JavaScript's peculiar behaviors! πŸš€πŸ’‘

Question 1: What's the result of [] + {}? πŸ€”

console.log([] + {}); // ?
Enter fullscreen mode Exit fullscreen mode

Question 2: Can you explain [] == ![]? 🧐

console.log([] == ![]); // ?
Enter fullscreen mode Exit fullscreen mode

Question 3: How does true + true behave? πŸ€”

console.log(true + true); // ?
Enter fullscreen mode Exit fullscreen mode

Question 4: What's the result of typeof null? πŸ€”

console.log(typeof null); // ?
Enter fullscreen mode Exit fullscreen mode

Question 5: What happens with !''? 🧐

console.log(!''); // ?
Enter fullscreen mode Exit fullscreen mode

Question 6: What's the output of 1 + 2 + '3'? πŸ€”

console.log(1 + 2 + '3'); // ?
Enter fullscreen mode Exit fullscreen mode

Question 7: Can you explain console.log('5' - 3)? 🧐

console.log('5' - 3); // ?
Enter fullscreen mode Exit fullscreen mode

Question 8: What's the result of console.log(typeof NaN)? πŸ€”

console.log(typeof NaN); // ?
Enter fullscreen mode Exit fullscreen mode

Question 9: How does console.log(1 + null) behave? 🧐

console.log(1 + null); // ?
Enter fullscreen mode Exit fullscreen mode

Question 10: What's the output of +'42'? πŸ€”

console.log(+'42'); // ?
Enter fullscreen mode Exit fullscreen mode

Question 11: How does console.log(undefined == null) behave? 🧐

console.log(undefined == null); // ?
Enter fullscreen mode Exit fullscreen mode

Question 12: What's the result of console.log('5' + 3)? πŸ€”

console.log('5' + 3); // ?
Enter fullscreen mode Exit fullscreen mode

Question 13: Can you explain console.log('5' - '2')? 🧐

console.log('5' - '2'); // ?
Enter fullscreen mode Exit fullscreen mode

Question 14: What's the output of console.log(0 == null)? πŸ€”

console.log(0 == null); // ?
Enter fullscreen mode Exit fullscreen mode

Question 15: How does console.log([] == ![]) behave? 🧐

console.log([] == ![]); // ?
Enter fullscreen mode Exit fullscreen mode

Question 16: What's the result of console.log([] + null)? πŸ€”

console.log([] + null); // ?
Enter fullscreen mode Exit fullscreen mode

Question 17: What happens with console.log(false == null)? 🧐

console.log(false == null); // ?
Enter fullscreen mode Exit fullscreen mode

Question 18: How does console.log(1 + '2' + 3) behave? πŸ€”

console.log(1 + '2' + 3); // ?
Enter fullscreen mode Exit fullscreen mode

Question 19: What's the output of console.log([] + undefined)? 🧐

console.log([] + undefined); // ?
Enter fullscreen mode Exit fullscreen mode

Question 20: Lastly, what does console.log(NaN === NaN) return? πŸ€”

console.log(NaN === NaN); // ?
Enter fullscreen mode Exit fullscreen mode

πŸš€ Ready to Unlock the Mysteries? πŸ’«

Put on your wizard's hat and dive into these JavaScript enchantments! Test your skills and see if you can unravel the quirks that make JavaScript both magical and perplexing! 🎩✨

Currently Dev.to Markdown Parsing has errors to see answers on GitHub Gist

Top comments (0)