#using [] instead of FindFirstChild()

15 messages · Page 1 of 1 (latest)

candid storm
#

is it bad to use instance[] instead of using instance:FindFirstChild() ?

novel fjord
#

it's just not consistent

#

cause an instance is not a table

#

but it pretty much behaves like one, specifically a dictionary

#

so no, it's not bad but stick to a single style across the codebase

#

often I see newbies mixing dot, . syntax with find first chid/Wait for child and brackets []

candid storm
candid storm
novel fjord
#

FFC is gonna iterate the array of children

#

while [] is a direct index

#

which is O(1)

#

you cannot get faster than that

candid storm
#

thats cool