• mbtrhcs@feddit.org
    link
    fedilink
    arrow-up
    4
    ·
    5 months ago

    …what? At least with Java Streams or Kotlin Sequences, they absolutely abort early with something like .filter().first().

    • metiulekm@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      5
      ·
      5 months ago

      Same in Python, Rust, Haskell and probably many others.

      But apparently JS does work that way, that is its filter always iterates over everything and returns a new array and not some iterator object.