All articles
shorts

Differences between braces, parentheses and square brackets

Share this article

Share on LinkedIn Share on X (formerly Twitter)

Braces

A brace is either of the two marks { and }. In programming the braces are usually used to surround a block of statements.

{ }

Square brackets

In programming, square brackets are used to pick an element from a list

[ ]

Parentheses

In programming, parentheses are used to invoke a function or during the declaration of function to group the arguments

( )

Comments