+ 4
Pls this two brackets ( ) and { } are confusing me, plz hw do i know when to use each of them.
Js
2 Answers
+ 11
The curly brackets {} are mostly used to define the code that belongs to a function:
function a(){
everything here is part of the func
}
And classes and objects. There are other things, but theyâre more rarely used. In time, youâll become familar with the langauge, and will have no trouble deciding for yourself. It just takes time and practice.
+ 2
{} in many C based languages define a code block and scope.