Analysis updated 2026-06-20
Read through surprising code snippets to understand why JavaScript behaves in ways most people don't expect, like 0.1+0.2 not equaling 0.3.
Prepare for technical interviews that test knowledge of JavaScript type coercion, operator precedence, and prototype behavior.
Install the npm package and browse the handbook from the command line to study JavaScript quirks at your own pace.
Use specific examples and their spec citations as a reference when debugging confusing JavaScript behavior in your own code.
| denysdovhan/wtfjs | tooljet/tooljet | drawdb-io/drawdb | |
|---|---|---|---|
| Stars | 37,595 | 37,869 | 37,161 |
| Language | JavaScript | JavaScript | JavaScript |
| Setup difficulty | easy | moderate | easy |
| Complexity | 1/5 | 3/5 | 1/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Readable directly on GitHub or installable via npm install -g wtfjs to read from the terminal, no setup beyond that.
WTF JavaScript is a curated collection of surprising, counter-intuitive, and sometimes hilarious JavaScript code examples, each one accompanied by an explanation of why the language behaves that way. The problem it solves is not a technical one but an educational one: JavaScript has many quirks baked into its specification that confuse beginners and catch even experienced developers off guard. Rather than pretending these quirks don't exist, this project shines a light on them. Each entry follows a simple format: a short snippet of valid JavaScript that produces a result most people would not expect, followed by an Explanation section that walks through the relevant specification rules. Examples range from the famous floating-point imprecision (0.1 + 0.2 not equaling 0.3) to stranger behaviors like an empty array being equal to the negation of an empty array, NaN not being equal to itself, and Math.max() returning a value smaller than Math.min() when called with no arguments. The explanations cite the JavaScript specification (ECMAScript) and walk through type coercion, operator precedence, and prototype rules, core language mechanics that are easy to misunderstand. You would use this repository when you want to deepen your understanding of JavaScript's type system and evaluation rules, prepare for technical interviews that probe language internals, or simply enjoy the humor of a language that occasionally feels like it was designed to trick you. The handbook is installable as an npm package (so you can read it from the command line), translated into multiple languages, and organized with a table of contents for easy browsing. The tech stack is minimal: it is essentially a Markdown document distributed as a Node.js npm package, written in JavaScript for its examples. No runtime framework or build system is involved.
A collection of surprising JavaScript code examples, each showing something that behaves unexpectedly, with clear explanations of why the language works that way, to help you understand its tricky corners.
Mainly JavaScript. The stack also includes JavaScript, Node.js.
License information is not mentioned in the explanation.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.