DEV Community

loading...

Discussion on: Python VS Javascript

Collapse
guico33 profile image
guico33

Python has mutable and immutable data types like set (mutable) and list (immutable).
Both set and list are mutable in Python afaik. Tuples aren't.

Javascript has no concept of mutable and immutable.
That is not quite true. Conceptually, immutability exists in js as it does in most languages I believe.
Some methods are mutative while others aren't (push vs concat for instance).
You can also use Object.freeze to prevent an object from being mutated.

Javascript has no built-in hash table support.
JavaScript has objects which can pretty much be used the same way as maps, but it also has the Map and Set built-in.

Collapse
yogeswaran79 profile image
Yogeswaran Author

Thank you for your comment and correcting me!