Both these languages seem extremely similar to me. Although Python supports actual classes instead of being prototype-based, in Python classes are not all that different from functions that generate objects containing values and functions, just as you'd do in JavaScript. On the other hand, JavaScript only supports floating-point numbers and strings as built-in data types.
These seem like fairly shallow differences to me, so these things aside, what are some more important differences between them?
var
keyword in Python, implicit globals in ECMAScript, both are lexically scopedundefined
in Python, exceptions are thrownswitch
statement in Python but instead you're encouraged to use a dictionary in that manner, sometimes its convenient assigning properties to lambdas and executing themyield
statement, nor let
expressions/statements, nor array comprehension
s - however these are included in Mozilla's JS which is non-standardraise
vs throw
, except
vs catch
( Python, JS )and
, is
, and not
are used in Pythoni++
Object.prototype
new
operator in Python to create objectsI stole a good bit of info from http://hg.toolness.com/python-for-js-programmers/raw-file/tip/PythonForJsProgrammers.html