Skip to content

Latest commit

 

History

History
41 lines (37 loc) · 1.84 KB

README.md

File metadata and controls

41 lines (37 loc) · 1.84 KB

Syntax / Python vs Javascript XLR

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)

Examples

Follow every .js file in the a-z0-9 order to keep moving.