Parentheses vs Brackets [JavaScript]

OK guys I’m pretty new to coding and I have to say what’s the differences between parentheses and brackets? When are they supposed to be used?

Do a google search
== discussions / opinions ==
javascript brackets vs parentheses
for instance

== the Book ==
brackets parentheses braces
brackets vs parentheses

Functions go between curly bracket: { }
Parenthesis () is used for conditions, console.log and more

I would say keep programming you will learn what goes where and how to use, “practice makes perfect!” and programming/coding requires practice

you should refer to this 4 as

[“brackets or square brackets”]
Brackets are used to index into an array.

Parentheses are used for two purposes: (1) to control the order of operations in an expression, and (2) to supply parameters to a constructor or method.

{“braces or curly braces”} Braces are used to group statements and declarations.
The contents of a class or interface are enclosed in braces.
Method bodies and constructor bodies are enclosed in braces.
Braces are used to group the statements in an if statement, a loop, or other control structures.

< > are called angle brackets

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.