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.

job ad

Saby Company
Delebio, Italy

Intermediate

d

Saby Company
Delebio, Italy

Junior

Featured Partners

Related Articles

View all articles
CH
Chris Heilmann
Dev Digest 136 - No JS(on) of mine
News and ArticlesDouglas Crockford is our featured video, so let's talk about evolving JavaScript and all things JSON. Judicious JSON explains all the weird things in it, you can learn why it can be incredibly slow, people wonder what even is a JSON ...
Dev Digest 136 - No JS(on) of mine
DC
Daniel Cranney
The State of HTML 2024: What can we learn from it?
The results of the State of HTML 2024 survey are in! Though the name suggests it’s HTML-only, the survey focuses on the web platform in a more general sense, giving us some fascinating insights into not only the state of the web, but also some sense ...
The State of HTML 2024: What can we learn from it?
CH
Chris Heilmann
Dev Digest 138 - Are you secure about this?
Hello there! This is the 2nd "out of the can" edition of 3 as I am on vacation in Greece eating lovely things on the beach. So, fewer news, but lots of great resources. Many around the topic of security. Enjoy! News and ArticlesGoogle Pixel phones t...
Dev Digest 138 - Are you secure about this?

From learning to earning

Jobs that call for the skills explored in this talk.

Code cleaner

Code cleaner

Cleanup Services
Rome, Italy

Remote
45-50K
Intermediate
PHP
JavaScript
Javascript Developer

Javascript Developer

Harrington Starr

76K
Node.js
Terraform
TypeScript
Continuous Integration