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([] + {}); // ?
Question 2: Can you explain [] == ![]
? 🧐
console.log([] == ![]); // ?
Question 3: How does true + true
behave? 🤔
console.log(true + true); // ?
Question 4: What's the result of typeof null
? 🤔
console.log(typeof null); // ?
Question 5: What happens with !''
? 🧐
console.log(!''); // ?
Question 6: What's the output of 1 + 2 + '3'
? 🤔
console.log(1 + 2 + '3'); // ?
Question 7: Can you explain console.log('5' - 3)
? 🧐
console.log('5' - 3); // ?
Question 8: What's the result of console.log(typeof NaN)
? 🤔
console.log(typeof NaN); // ?
Question 9: How does console.log(1 + null)
behave? 🧐
console.log(1 + null); // ?
Question 10: What's the output of +'42'
? 🤔
console.log(+'42'); // ?
Question 11: How does console.log(undefined == null)
behave? 🧐
console.log(undefined == null); // ?
Question 12: What's the result of console.log('5' + 3)
? 🤔
console.log('5' + 3); // ?
Question 13: Can you explain console.log('5' - '2')
? 🧐
console.log('5' - '2'); // ?
Question 14: What's the output of console.log(0 == null)
? 🤔
console.log(0 == null); // ?
Question 15: How does console.log([] == ![])
behave? 🧐
console.log([] == ![]); // ?
Question 16: What's the result of console.log([] + null)
? 🤔
console.log([] + null); // ?
Question 17: What happens with console.log(false == null)
? 🧐
console.log(false == null); // ?
Question 18: How does console.log(1 + '2' + 3)
behave? 🤔
console.log(1 + '2' + 3); // ?
Question 19: What's the output of console.log([] + undefined)
? 🧐
console.log([] + undefined); // ?
Question 20: Lastly, what does console.log(NaN === NaN)
return? 🤔
console.log(NaN === NaN); // ?
🚀 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