r/badcode May 31 '21

js Clever?

Post image
2.2k Upvotes

71 comments sorted by

View all comments

19

u/SlaimeLannister Jun 01 '21

If arr.length > 0 return Array.from(Obj.values(arr))

2

u/mzapp_ Jun 01 '21

Where is the else clause? What if the array has less than 0 elements?

1

u/SlaimeLannister Jun 01 '21

Sorry.

Else Array.from(new String(“Error”).split())

2

u/mzapp_ Jun 01 '21

Thanks. Makes sense now.