lysdexic@programming.dev to Programming@programming.devEnglish · 4 months agoCode Smells Catalogluzkan.github.ioexternal-linkmessage-square23fedilinkarrow-up158arrow-down15
arrow-up153arrow-down1external-linkCode Smells Catalogluzkan.github.iolysdexic@programming.dev to Programming@programming.devEnglish · 4 months agomessage-square23fedilink
minus-squaremetiulekm@sh.itjust.workslinkfedilinkEnglisharrow-up9·4 months agoSame 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.
minus-squarenous@programming.devlinkfedilinkEnglisharrow-up3·edit-24 months agoThe old methods on Array will eagerly evaluate all elements. But JS has a new Iterator type with methods that works lazily instead.
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.The old methods on Array will eagerly evaluate all elements. But JS has a new Iterator type with methods that works lazily instead.