paint-brush
Why You Shouldn't Use "With Statement" Syntax in JavaScriptby@wagslane
342 reads
342 reads

Why You Shouldn't Use "With Statement" Syntax in JavaScript

by Lane Wagner2mJanuary 16th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Use of the with statement is discouraged, but it is important to understand how it works. Using with can make long pieces of code easier to read due to the removal of long accessor paths. The danger or potential bugs due to ambiguity isn’t worth it. There is an argument to be made that code will be smaller and easier to send to the browser by using ‘with’ statements. While true, the gains are negligible, especially when compared to what minified code can do.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Why You Shouldn't Use "With Statement" Syntax in JavaScript
Lane Wagner HackerNoon profile picture
Lane Wagner

Lane Wagner

@wagslane

Founder of Boot.dev. Whining about coding sins since 2011. Committing coding sins for the same.

About @wagslane
LEARN MORE ABOUT @WAGSLANE'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Lane Wagner HackerNoon profile picture
Lane Wagner@wagslane
Founder of Boot.dev. Whining about coding sins since 2011. Committing coding sins for the same.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here
Learnrepo