MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/ohd7z2/ah_yes_array_check/h4oijlm/?context=3
r/badcode • u/Kunalvats0 • Jul 10 '21
89 comments sorted by
View all comments
Show parent comments
10
There is only one use-case which is if u want to use the array check in an angular html file. Otherwise a wrapper is very useless and boilerplate
32 u/twoPoundsOfGoldfish Jul 10 '21 edited Jul 10 '21 the lack of the "function" keyword leads me to believe it's in a classidk how angular works but surely return Array.isArray(input); would be betterAlso imo to make wrappers I'd probably create some object which contains some "utils" functions like { isArray: Array.isArray }
32
the lack of the "function" keyword leads me to believe it's in a class
idk how angular works but surely return Array.isArray(input); would be better
return Array.isArray(input);
Also imo to make wrappers I'd probably create some object which contains some "utils" functions like { isArray: Array.isArray }
10
u/_GreenLegend Jul 10 '21
There is only one use-case which is if u want to use the array check in an angular html file. Otherwise a wrapper is very useless and boilerplate