throwawa923423
Re:FP techniques that will help you write better JavaScript
on Friday February 11, 2022 @06:37PM (#30308342)
I think it is important that you brought awareness to this, this is a really good point and I agree 100%. JavaScript does have hygiene issues with its API design.
Re:FP techniques that will help you write better JavaScript
on Friday February 11, 2022 @06:32PM (#30308301)
I get where you are coming from, but it is obvious to me `forEach` is side effect because of its return type.
Also I think `forEach` is great for cases such as `arr.forEach(f)` where `arr: Array<T>, f: T => void`.