In chrome devtools, when I input
> {a:1}
I got { a: 1 }
object as the return value, which is understandable.
But when I add a comment after it
> {a:1}//
The return value becomes 1
.
It might be a trivial question but it does make me scratch my head for a long time.
I assume the devtool interprets the {}
as a code block and a
as a tag name. But why adding a comment //
would make such a difference? Is it the intended behavior?