3 ms·
A couple reasons, which are used consistently throughout Swift: Shuffled may accept arguments. First does not The runtime cost of first is nearly zero, wherea
by bobbylarrybobby 8y ago
A couple reasons, which are used consistently throughout Swift:
Shuffled may accept arguments. First does not
The runtime cost of first is nearly zero, whereas shuffled is doing significant work (constant versus linear time)
It sort of doesn’t matter because autocomplete won’t let you do the wrong thing.