I can't get my head around this syntax, what does the set of curly-braces after "use strict" do?
function test(a, b) {
'use strict';
{
var c = {};
Array.prototype.slice
}
... //more stuff
return a;
}
It is just a regular block. In Javascript, blocks like those have no specific scope. They follow the flow of the code as it is.
This means that you can safely ignore (or remove) them without any effect on the code.
function test(a, b) {
'use strict';
// no curly braces here
var c = {};
Array.prototype.slice
// neither here
... //more stuff
return a;
} //one and the same thing
You can read more about scope in Javascript in this Stackoverflow post.