Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

JS ↔ Python Bridge

Learn JavaScript and Python by relating them — not by memorizing two separate languages.

Whether you're a JS developer learning Python, or a Python developer learning JS, every lesson puts the same idea side by side, then calls out where they diverge.


How to use this repo

Path A — I'm a JS developer → learn Python

  1. Open each lesson folder.
  2. Read js.js first (you already know this).
  3. Read py.py next — same examples, Python syntax.
  4. Read NOTES.md for differences, gotchas, and mental models.

Path B — I'm a Python developer → learn JS

  1. Open each lesson folder.
  2. Read py.py first (you already know this).
  3. Read js.js next — same examples, JS syntax.
  4. Read NOTES.md for differences, gotchas, and mental models.

Comment tags you'll see in code

Tag Meaning
# SAME / // SAME Same concept, different syntax
# DIFF / // DIFF Important behavioral difference
# GOTCHA / // GOTCHA Easy trap when switching languages
# PY-ONLY / // JS-ONLY Feature that doesn't map cleanly

Curriculum

01 — Fundamentals

# Topic What you'll relate
01 Variables & Types let/const ↔ assignment, dynamic typing
02 Operators Arithmetic, comparison, truthiness
03 Strings Templates, f-strings, methods
04 Control Flow if/elif/else, ternary, switch vs match
05 Functions Defaults, rest/args, lambdas/arrows
06 Collections Arrays↔lists, objects↔dicts, Set, Map
07 Loops for/while, for...of ↔ for in
08 Error Handling try/catch ↔ try/except

02 — Intermediate

# Topic What you'll relate
01 Scope & Closures LEGB ↔ lexical scope
02 Modules import/export ↔ import/from
03 Functional Patterns map/filter/reduce ↔ list comps
04 Destructuring & Unpacking Object/array destructuring ↔ unpacking
05 Async / Await Promises ↔ asyncio, gather ↔ Promise.all

03 — Object-Oriented Programming

# Topic What you'll relate
01 Classes & Instances class, constructors, this ↔ self
02 Inheritance extends/super ↔ subclassing
03 Encapsulation #private ↔ _ / __ name mangling
04 Polymorphism & Duck Typing Interfaces vs duck typing
05 Special Methods & Operators toString ↔ __str__, operator overloading

06 — Professional (mid-senior bridge)

# Topic What you'll relate
01 Typing TS/JSDoc ↔ typing / Protocol / TypedDict
02 Tooling & Packaging npm/node ↔ pip/uv/venv
03 Testing node:test/Jest ↔ pytest
04 Stdlib Day-One fs/path/fetch ↔ pathlib/json/collections
05 Concurrency Beyond Basics workers ↔ threads/processes/GIL
06 Errors & Null Style ?. ?? ↔ Optional / Result style
07 Ecosystem Bridge Express↔FastAPI, Zod↔Pydantic, …
08 Production Habits env, logging, layout, CI hygiene

Extra


Run the examples

# JavaScript (Node.js)
node 01-fundamentals/01-variables-and-types/js.js

# Python 3
python 01-fundamentals/01-variables-and-types/py.py

# Built-in JS tests (professional track)
node --test 06-professional/03-testing/js.js

Language lessons need no framework. Professional tooling notes show the real-world stack you'll use on a team.


Learning tip

Don't rush past the DIFF and GOTCHA comments — those are where real understanding happens. Syntax is easy to look up; mental models stick when you see why the languages disagree.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages