MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/ohd7z2/ah_yes_array_check/h4ryhv1/?context=3
r/badcode • u/Kunalvats0 • Jul 10 '21
89 comments sorted by
View all comments
317
The upside is that they didn't use an else
117 u/Mwakay Jul 10 '21 The downside is that they used a if statement, then used two different return for the two boolean outcomes.Instead of just going the return Array.isArray(input) route. 114 u/[deleted] Jul 10 '21 Of just ignore the method entirely and use array.isarray everywhere 1 u/CodeF53 Jul 11 '21 Sometimes it just doesn't work like that.
117
The downside is that they used a if statement, then used two different return for the two boolean outcomes.
Instead of just going the return Array.isArray(input) route.
114 u/[deleted] Jul 10 '21 Of just ignore the method entirely and use array.isarray everywhere 1 u/CodeF53 Jul 11 '21 Sometimes it just doesn't work like that.
114
Of just ignore the method entirely and use array.isarray everywhere
1 u/CodeF53 Jul 11 '21 Sometimes it just doesn't work like that.
1
Sometimes it just doesn't work like that.
317
u/grantholle Jul 10 '21
The upside is that they didn't use an else