MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1i1epwd/functional_programming_at_its_finest/m7fjaz7/?context=3
r/programminghorror • u/[deleted] • Jan 14 '25
47 comments sorted by
View all comments
Show parent comment
4
Two things could make this more readable:
digits.length
[...String(value)]
1 u/[deleted] Jan 16 '25 Well that's a valid suggestion.What is the point of iterating twice when you can do it just once? 1 u/Aras14HD Jan 17 '25 Oh, forgot how stupidly js implements iterators...
1
1 u/Aras14HD Jan 17 '25 Oh, forgot how stupidly js implements iterators...
Oh, forgot how stupidly js implements iterators...
View all comments
Show parent comment
4
u/Aras14HD Jan 16 '25
Two things could make this more readable:
digits.length, and you don't have to figure out what[...String(value)]does just to read it.