Whenever I read a functional programming tutorial or course, it always sings the praises of how there's an
amazing REPL you can use to experiment with your code, or it will teach how to map and reduce over sequences, or first-class functions, or currying.
The problem for me is, all of these awesome features already exist in popular languages like JS and Python.
Then there's the "purity" side of things. For e.g. tutorials for Haskell and Clojure say that "mutation and side effects are not allowed" which makes for a more predictable program. But in my experience, I can totally just re-define variables in the REPL and no one stops me. I don't even get a warning. So I'm not sure if I'm missing something, but so far it doesn't feel so different from writing fancy ES6 syntax.
The last thing is "macros". This one seems to be actually unique to FP languages like Clojure, etc. But is this the only unique feature of FP languages?
Genuinely curious, please help me clear up my understanding. I have so far been following some fun Clojure and Haskell tutorials and these languages are very fun/sleek/logical to write in.
I am just wondering if I could accomplish the same in JS easily without learning whole new languages and ecosystems.
That said, you should also think in terms of "What does JavaScript have that functional programming doesn't?". As a working-stiff programmer, most of the time the problems you're going to encounter are going to be a lot easier and faster to solve if mutating state is available as an option.