What is {... code ...} in javascript?

{
var x = 0;
...
}

      

What are the intended curly braces, this is clearly not a function or loop, it is just empty curly braces with anything before.

ps if anyone finds a better way to rephrase this question please do

+3


source to share


1 answer


Those are called block operators, they just have to group together commands that need to be executed together.



Here are some useful links: https://www.w3schools.com/js/js_statements.asp https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/block

+4


source







All Articles