Hacker News new | ask | show | jobs
by kllrnohj 25 days ago
...which is the same as nearly every other language? What language doesn't have that same collection of stuff?

Java: for, for-each, do-while with iterator, list.forEach(..), list.stream().forEach(..), etc...

1 comments

Python?
for i in list, enumerate(), for i in range(len(list)), while loop, list comprehension as a map, generator expressions, map() function, iter(list) + next()

The only thing it seems to be missing is a for_each function, assuming you aren't doing a map() in which case then that exists.