News for hackers. Stuff that matters.
Re:Using const/let instead of var can make JavaScript code r... by giantDinosaur on Thursday October 22, 2020 @01:01AM (#24855040)
Really, I just have a somewhat FP bias, and I'd really enjoy it if const was actually immutable, since it'd be a nice concise way of expressing that. It's just not as useful as you'd think given how often it seems to be used (by contrast I almost never see anyone actually making anything immutable in JS).
Re:Using const/let instead of var can make JavaScript code r... by yashap on Thursday October 22, 2020 @10:51AM (#24858621)
I like FP too, but most languages, including FP ones, have both mutable/immutable references and mutable/immutable values. And in JS, things like strings, numbers and booleans are immutable value, plus immutable.js is quite popular for immutable data structures, especially in React+Redux apps.