
Object-Oriented JavaScript - Second Edition
By :

In the preceding examples, you saw the use of code blocks. Let's take a moment to clarify what a block of code is, because you use blocks extensively when constructing conditions and loops.
A block of code consists of zero or more expressions enclosed in curly brackets:
{ var a = 1; var b = 3; }
You can nest blocks within each other indefinitely:
{ var a = 1; var b = 3; var c, d; { c = a + b; { d = a - b; } } }
Best practice tips
Use end-of-line semicolons, as discussed previously in the chapter. Although the semicolon is optional when you have only one expression per line, it's good to develop the habit of using them. For best readability, the individual expressions inside a block should be placed one per line and separated by semicolons.
Indent any code placed within curly brackets. Some programmers like one tab indentation, some use four spaces, and some use two spaces. It really doesn't matter, as long as you're consistent. In the preceding example...
Change the font size
Change margin width
Change background colour