If the syntax for JavaScript object literals is
{ label: value, label: value, ... }
then why is it that I’ve seen some people use this in their code?
{window}
What is its purpose? I’ve tried that and it evaluates to window as it would without the braces. It doesn’t even fit in with the object literal notation. Is it a code block?
In the answer you referenced the poster is using a block purely as a form of commenting – he’s using the structure it provides to make it clear that it’s a separate block of work, but it has no intrinsic value to the code.
Clearly it’s use as pseudo-comment is debatable if it confused you. I would tend to avoid it in favour of actual comments.