Peter Kröner

Best of the Worst – the most awful anti-features in JavaScript, ranked!

Did you know one JavaScript feature makes all your code slower, even if you never use it? Let's rank the language's worst anti-features.

Best of the Worst – the most awful anti-features in JavaScript, ranked!
#1about 2 minutes

Ranking the worst features in JavaScript's history

An introduction to JavaScript's most confusing and sometimes useful anti-features, ranked using a classic internet tier list.

#2about 4 minutes

The unexpected behavior of primitive object wrappers

Primitive wrappers like `new Boolean(false)` create objects that are always truthy, leading to confusing behavior in conditional statements.

#3about 5 minutes

Using the function constructor to access the global scope

The `new Function()` constructor always executes in the global scope, providing a reliable way to bypass locally shadowed global variables like `window` or `undefined`.

#4about 2 minutes

How JavaScript's global scope and environment records work

The global scope is a special environment record that uses the `window` object as a backend for storing variables.

#5about 3 minutes

Why the `with` statement slows down all JavaScript code

The `with` statement prevents static analysis of variable locations, forcing JavaScript engines to disable certain optimizations and making all code potentially slower.

#6about 3 minutes

How new keywords are added without breaking old code

JavaScript introduces new syntax like `for...of` by using contextual keywords, which are only treated as keywords in specific positions to maintain backwards compatibility.

#7about 6 minutes

The many pitfalls and traps of using parseInt

`parseInt` has multiple issues, including returning a float and auto-detecting hexadecimal prefixes, which can lead to unexpected bugs.

#8about 1 minute

A rapid review of other strange JavaScript features

A quick look at other historical oddities like `document.all`, `new Array()`, and deprecated string HTML wrapper methods.

Related jobs
Jobs that call for the skills explored in this talk.
tree-IT GmbH

tree-IT GmbH
Bad Neustadt an der Saale, Germany

54-80K
Intermediate
Senior
Java
TypeScript
+1

Featured Partners

Related Articles

View all articles
DC
Daniel Cranney
Dev Digest 198: 30 years of JS, In-Browser AI, How Attackers Abuse GenAI
Inside last week’s Dev Digest 198 . 🎂 30 years of JavaScript ⏰ How long is a JavaScript second 💻 Clean code in Angular 🤦‍♂️ AI makes different mistakes than humans 👨‍💻 In-browser and offline AI 🟠 Undocumented Hacker News features 🐋 DeepSeek censored...
Dev Digest 198: 30 years of JS, In-Browser AI, How Attackers Abuse GenAI
CH
Chris Heilmann
Links and anchors: ancient HTML and JS magic in your browser
Have you ever wondered why you use an <a> element to add link to an HTML document? Paragraph is <p>, unordered list is <ul>, image is <img> but why <a> instead of <link>? Well, the reason is that the element both defines where to go to, but also an e...
Links and anchors: ancient HTML and JS magic in your browser

From learning to earning

Jobs that call for the skills explored in this talk.