{ } Braces provide grouping around a series of statements to show they all go together, for example, as part of a function or within a loop.
( ) Parentheses are used when you call functions or built-in methods (like fillRect or fillCircle) to show where the parameters go.
It becomes pretty clear when you see it used. The only problem is that with a normal sized font, they can look pretty similar.
Because the designers of Javascript assigned very different meanings to the two sorts of brackets, using the wrong type simply won't work.
|