JavaScript Quiz Part 10: Can You Pass? #javascript #coding #quiz

preview_player
Показать описание
YOU should SOLVE this JavaScript Quiz 🤯

Answer Explanation:
Object keys are automatically converted into strings. We are trying to set an object as a key to object a, with the value of 123.

However, when we stringify an object, it becomes "[object Object]". So what we are saying here, is that a["[object Object]"] = 123. Then, we can try to do the same again. c is another object that we are implicitly stringifying. So then, a["[object Object]"] = 456.

Then, we log a[b], which is actually a["[object Object]"]. We just set that to 456, so it returns 456.

Most Asked Coding Interview Questions!
FAANG Coding Interview Questions and Answers
Ebay Coding Interview Question
Amazon Coding Interview Question
Google Coding Interview Question
LinkedIn Coding Interview Question

#MostAskedCodingQuestions
Рекомендации по теме