Python | JavaScript |
---|---|
def (...): | function(...) {} |
if ...: | if (...) {} |
while ...: | while (...) {} |
elif ...: | } else if (...) { |
else: | } else { |
pass | {} |
print(...) | console.log(...) |
True | true |
False | false |
None | null |
Or | || |
And | && |
Unset | undefined |
not | ! |
is | === |
del | delete |
\n | ;\n |
# comment | // comment |
str(...) | String(...) |
bool(...) | Boolean(...) |
int(...) | Number(...) |
import pdb; pdb.set_trace() | debugger; |
try: | try { |
except | catch |
except Exception as e | catch(e) |
.append(...) | .push(...) |
raise 'error' | throw 'error'; |
import x | var x = require(x) |
import x as _ | var _ = require(x) |
"String" | 'String' |
"""String""" | 'Str' + 'ing' |
@decorator | f = decorator(f) |
Follow every .js
file in the a-z0-9 order to keep moving.