Your image just shows you don't understand very much about the language. It's not "wrong" once you understand what it's doing and why. Show it to anyone who understands what is happening, and you'll look quite foolish. It's not massively complex once you read "Javascript: The definitive guide (O'Reily)" - the best book on js by a mile.
var obj1 = {};
// var doesn't return anything, so the interpreter shows 'undefined'.
var obj2 = {};
// same again
obj1 == obj2;
// Well no, they're different objects. So you'll get false
var thing = {};
//
thing[obj1] = "hi";
// OK this is an odd thing to want to do, but you're doing it anyway.
// You're using an *object* (obj1), as a key.
// The js thinks you're idiotic, but complies by calling the .toString() method,
// and gets "[object Object]" or similar by default.
// (You're free to override that on your object).
thing[obj2]
// Once again, you're using an object as a key
// and acting surprised that js has changed it into a string.
// So, you created an object and set thing["object Object"] = "hi"
So instead of "Wow! js is retarded", my response to that code would be "Why is he trying to use objects as keys? and why is he surprised when js converts them to strings?"
I recommend the above book to clear up things like this.