The with Statement
browser tricks 1996 partlywith dumped an object's every property into scope, saving keystrokes and destroying certainty about what any name meant.
In 2026: Partly. It still runs in a plain script tag, as the demo proves, but strict mode and modules ban it outright, so it cannot survive contact with modern code. Engines hate it because one with block turns every variable lookup into a guessing game. The keyword remains reserved forever, a monument to convenience.
Where it came from: JavaScript 1.0, Netscape 2, 1996. Banned by strict mode in ECMAScript 5, 2009. MDN ↗
<script language="JavaScript">
// Why type document.form1 five times when you can just... not?
with (document) {
write("<p>Written from inside a with block.</p>");
}
with (Math) {
document.write("<p>Circle area, radius 5: " + round(PI * pow(5, 2)) + "</p>");
}
</script>