Guess the JavaScript Output: Very Tricky!

Sadeedpv🥇 - Oct 5 '23 - - Dev Community

This post is part of a series called Guess the JavaScript Output
And today's question is a bit tricky one:

What will be the output of the following code?

let a = {};
let b = { key: "b" };
let c = { key: "c" };

a[b] = 123;
a[c] = 456;

console.log(a[b]);
Enter fullscreen mode Exit fullscreen mode

Uncle Mike solved this within 20s (Mike started coding in the womb and has built his own OS called MikeOS).
If you'd like to see more of the series, please give it a like.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player