- What is the purpose of curly brackets ?
- What's the difference between a brace and a bracket ()?
- What do you use [] for?
What is the purpose of curly brackets ?
(curly braces)
Define the beginning and end of functions blocks and statement blocks such as the for and if structures. Curly braces are also used for defining initial values in array declarations.
What's the difference between a brace and a bracket ()?
Parentheses are smooth and curved ( ), brackets are square [ ], and braces are curly . In mathematics, they are mostly used for order of operations. The innermost parentheses are calculated first, followed by the brackets that form the next layer outwards, followed by braces that form a third layer outwards.
What do you use [] for?
Square brackets, often just called brackets in American English, are a set of punctuation marks that are most often used to alter or add information to quoted material.