Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
ksikka
on Oct 20, 2015
|
parent
|
context
|
favorite
| on:
Goodbye CoffeeScript, Hello TypeScript
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Touche
on Oct 20, 2015
[–]
const a = {b: "foo"}; a.b = "bar";
pyrophane
on Oct 20, 2015
|
parent
|
next
[–]
Yea, const provides immutability with respect to assignment, but without immutable objects and collections, it isn't going to get you all the way.
dangoor
on Oct 20, 2015
|
parent
|
prev
[–]
const a = icepick.freeze({b: "foo"});
Granted, that's not as elegant as built-in support but that is literally what I'm doing at the moment when I want immutability.
Touche
on Oct 20, 2015
|
root
|
parent
[–]
So if you go to extraordinary lengths you can use JavaScript functionally but it's not very functional by default aside from the first-class functions. Personally I just embrace it's imperative/functional blended nature and go with it.
Join us for
AI Startup School
this June 16-17 in San Francisco!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: