r/badcode • • Jul 10 '21

js ah yes, Array check

Post image
2.1k Upvotes

89 comments sorted by

View all comments

255

u/twoPoundsOfGoldfish Jul 10 '21

the funny bit is that this was probably added to be more readable but just using Array.isArray would be so much more readable than using a function which calls Array.isArray

0

u/[deleted] Jul 10 '21

[deleted]

0

u/[deleted] Jul 10 '21

[deleted]

2

u/romainmoi Jul 10 '21

The code is definitely bad. Creating a function that only calls a function is arguable.

4

u/BongarooBizkistico Jul 10 '21

Thought you were defending it.