DEV Community

Cover image for Python VS Javascript

Python VS Javascript

Yogeswaran on March 20, 2019

1. REPL (Read Eval Print Loop) Python: You’ll get it with the installation of python and call different python versions depending on th...
Collapse
 
guico33 profile image
guico33 • Edited

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

Thank you for your comment and correcting me!

Collapse
 
paulcook159 profile image
Paul Cook

Thanks for sharing informative article. Both Python and JavaScript have consistently remained at the top of the most popular programming languages. Both are object-oriented programming languages, their scopes are different. Python and JS have a lot in common but with some significant differences. JavaScript is a scripting language used to create and control dynamic website content and Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Python beats JavaScript at data science and user-friendliness, JavaScript surpasses Python in frontend development and performance. compersion is better to understand which is better, Found one blog check out here bit.ly/380n5LK

Collapse
 
djangotricks profile image
Aidas Bendoraitis

Great overview.

I was a little surprised that integers are not part of JavaScript, but then I checked that typeof 7 returns "number". The same as any other type of number.