Side-by-side, interactive cheatsheets for JavaScript programmers
comparing JavaScript to other languages. Every example runs live in your browser — no setup, no installation.
Choose your own path by reordering languages
The language that inspired Rails and shaped modern web development, Ruby offers a radically different model from JavaScript — pure OOP, synchronous-first, and expressive in a way that prioritizes human readability above all.
JavaScript's flexibility, but with static types, true concurrency, and a single deployable binary. Go trades the event loop and dynamic typing for goroutines, compile-time type safety, and 10–100× faster CPU-bound throughput.
async/await runs on a single thread and never uses multiple CPU coresundefined is not a function errors in productionnull/undefined confusion — every type has a defined zero value; accessing an uninitialized variable gives a predictable 0 or "", never undefinedgo build produces one file with no runtime to install, no node_modules, no version manager needed on the serverThe language of data and scripting, Python is where most JavaScript developers go for data science, machine learning, and serious back-end work.
None instead of both null and undefined== with no coercion — no === needed[x*2 for x in items]) in place of map/filter chainsself and an __init__ constructor, no newFlutter's language meets the web's language. Dart's sound null safety, typed collections, and async-first design offer a fundamentally different approach to safety and scalability than JavaScript's dynamic flexibility.
String can never be null; String? can. The compiler prevents null dereferences before the program runsfinal is Dart's const — variables are immutable by default; var is mutable (opposite of JavaScript's let/const semantics)List<int>, Map<String, double> — mixing types is caught at compile time, not discovered at runtimerequired — more explicit than JavaScript's destructuring pattern and enforced by the compilerKotlin is what you reach for when JavaScript's dynamism starts costing you more than it saves. Null becomes a type-checked possibility instead of a runtime landmine, data classes replace hand-rolled object literals with real equality, and when plus sealed classes give you the exhaustive branching a switch statement never enforced — all compiled ahead of time to the JVM.
String can never be null and String? must be handled before use; no more TypeError: Cannot read properties of null discovered at runtimedata class Person(val name: String, val age: Int) gets working equals, hashCode, toString, and copy(); a JavaScript object literal gets none of these for freetypeof guards or runtime shape-checking; a whole category of JavaScript bugs never reaches productionwhen — the compiler forces every case to be handled, something a JavaScript switch can never guaranteesuspend fun reads like sequential code and coroutineScope guarantees structured cleanup, a stronger guarantee than a bare Promise chain or dangling async callJavaScript's dynamism without the runtime surprises. Rust brings static types, memory safety without a GC, and true parallelism — while keeping closures, iterators, and expressive code patterns you'll recognize.
null or undefined — Option<T> makes absence explicit in the type system, eliminating an entire class of runtime errorsResult<T, E> makes every error path explicit and type-checked — no more silent throws propagating through async call stacksmatch — more powerful than switch, works on any type, and the compiler enforces handling every caseApple's modern language meets the web's language. Swift's type system, optionals, and protocols offer a fundamentally different approach to safety than JavaScript's dynamic flexibility.
let means constant in Swift — the reverse of JavaScript where let is mutable and const is fixedString?) replace null and undefined — absence is tracked in the type system, not discovered at runtimeswitch is exhaustive and far more powerful than JavaScript's — ranges, tuples, type checks, and where clauses all in one constructThe JavaScript you already know, with a type system that catches whole classes of bugs before they ship. TypeScript is a strict superset — every JS file is valid TS, and you adopt it at your own pace.
string, number, boolean, plus interfaces and aliases you define yourselfimplements declaration needed, just match the structureanyif-checks and eliminates impossible types as control flow progressesPartial, Pick, and Readonly — a whole algebra of type transformations with no runtime costA small, explicit systems language with no hidden control flow. Zig is where a JavaScript developer goes for native speed, manual memory, and compile-time guarantees.
u8, i32, f64) instead of one dynamic number?T) and error unions (!T) replace null/undefined and throwboolcomptime runs ordinary Zig at compile time — generics with no separate macro languageWhat a compiler asks of you, and what it gives back. Java shares JavaScript's braces and almost none of its assumptions — you declare types up front, say which errors a method can throw, and pick an implementation for every collection. In exchange you get real threads, and errors caught before the program runs.
== compares references, so string and object comparison needs equals() — the reverse of the lesson JavaScript teachesasyncif takes a boolean, so there is no falsy-value list to memorizeEverything Node taught you about not blocking, inverted. A PHP request is a fresh process that runs top to bottom, blocks whenever it likes because nobody else is in it, and then throws the whole world away. No event loop, no promises, no async coloring — and one array type that copies on assignment where every JavaScript object is a reference.
file_get_contents and a database query just return, so no function needs an async twin and stack traces reach the entry pointarray is list and dictionary at once, ordered, and copied on assignment — objects stay references exactly as in JavaScript, and that split catches everyone$_GET/$_POST/$_SESSION rather than an object handed to your handlermatch, enums, readonly properties, constructor promotion, named arguments and ?-> are all here — modern PHP is not the PHP you rememberstr_replace($search, $replace, $subject) ordered one way and strpos($haystack, $needle) the othernode_modulesOCaml meets JavaScript. ReScript compiles to clean JavaScript while enforcing a sound type system, algebraic data types, and exhaustive pattern matching — eliminating entire classes of bugs that JavaScript's dynamic nature permits.
option<string> is guaranteed to be Some("text") or None, never an accidental null{ type: "circle" } pattern — Circle(radius) is a typed constructor the compiler exhaustively checksswitch — the compiler errors if you miss any variant case, eliminating the silent default: return undefined bugs-> pipe operator chains operations left-to-right — composable with any function, not just methods on an objectGodot's native scripting language, and the natural next engine for a DragonRuby developer — dynamically typed like Ruby, Python-flavored in syntax, with the game's structure living in a retained tree of nodes rather than in one tick function.
args.state every tick; Godot gives you persistent nodes you mutate in _process(delta)died and anything can subscribe, replacing the flag you would poll every tickyield — behavior is passed as a Callable (func(x): return x * 2) and invoked with .call()raise, no rescue; failures come back as error codes or sentinel values that every caller checksvar speed := 200.0 is checked when the script loads and compiles to faster bytecode, which matters at 60 frames a secondmatch is real pattern matching, destructuring arrays and dictionaries much like Ruby 4's case/in