Re:FP techniques that will help you write better JavaScript
by bryanrasmussen on Friday February 11, 2022 @05:40AM
(#30299780)
I don't understand this no it doesn't, the logic I outlined can be boiled down to
If I only need to do X
And X cannot do Y
Then I do not need to do Y
-----------------------------
If I need to do Y
And X cannot do Y
Then I need to do something other than X
-------------------------
Give your answer of no it doesn't please be so kind as to outline the logical reasoning that you are envisioning?
on edit: added line between logical statements.
Re:FP techniques that will help you write better JavaScript
by yakshaving_jgt on Friday February 11, 2022 @05:44AM
(#30299814)
Unless I've misunderstood you, you said that, for example, `continue` cannot be implemented in terms of `map`, which simply isn't true. It's trivial.
Re:FP techniques that will help you write better JavaScript
by bryanrasmussen on Friday February 11, 2022 @05:49AM
(#30299862)
I thought the original statement was break or continue, I was actually focusing on break? As far as I know you don't break in map, you can return null but not break the loop itself.
on edit: although I almost never break in a loop, I use some other construct instead.
on second edit: maybe I should say iteration instead of loop but will let it stand.
Re:FP techniques that will help you write better JavaScript
by yakshaving_jgt on Friday February 11, 2022 @06:05AM
(#30299967)
It's not clear to me what you're trying to achieve. Sorry.
No it doesn’t.