Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a difference between 'Name' and ("Name")?

Asked by 6 years ago

Like when doing :FindFirstChild("Part") or :FindFirstChild'Part' .

Is one of them deprecating?

0
No BlackOrange3343 2676 — 6y
0
No theCJarmy7 1293 — 6y
0
The FindFirstChild”Part” is faster, and if you’re not going to use the FindFirstChild second argument, I recommend not including the brackets. User#19524 175 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

If you're calling a function and passing one table literal or string literal, you can omit the brackets.

foo "bar"
foo {"bar"}

is syntactic sugar for

foo("bar")
foo({"bar"})

Both function calls are exactly the same, it's subjective and neither option provides a performance increase.

0
I never knew you could do that with tables. I knew with strings, like print”Hello world” is acceptable but i never knew you could do it with tables too. User#19524 175 — 6y
0
which moron downvoted my answer User#20923 0 — 6y
Ad

Answer this question