🎩 JavaScript Magic: 20 Quirky Questions! 💫

Sh Raj - Apr 12 - - Dev Community

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

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .