I was playing around with some Javascript snippets today and noticed that this code would actually run:
{{for(var i = 0; i < 3; i++) {{{{
alert(i);
}}}}}}
You can try it out for yourself on jsFiddle.
Why does this run without any syntax errors? What do the repeated brackets mean? Does Javascript just ignore repeated curly braces?
{ x++; }is a “Block Statement“.{{{ x++; }}}is a block inside a block inside a block.The code inside each block is executed. So adding extra
{}around someting doesn’t do anythng.