Is there a difference between this
local a = Instance.new(t, p or game.Workspace)
and this
local a = Instance.new(t, (p or game.Workspace) )
Is there a difference between this
local a = Instance.new(t, p or game.Workspace)
and this
local a = Instance.new(t, (p or game.Workspace) )
In this case, there is no difference. However, if you wanted to say something like this:
local r = false
local a = Instance.new(t, (r and p or game.Workspace) )
It's better to have parentheses for expressions with several and's and/or or's
...but the parenthesis would do better clarifying the o-o-o on the and and or, and not on the comma
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Not really. :) Parentheses aren't necessary in this situation. :P In my opinion (or understanding), the Parentheses are like the Mathematical ways (Example: P.E.M.D.A.S.); Parentheses comes first (and I think this does the same affect for 'If' statements as well :o ) when it comes to a specific Mathematical term. :)