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

Written by wagslane | Published 2020/01/16
Tech Story Tags: javascript | with-statement | programming | nodejs | react | beginners | software-development | design-patterns

TLDR 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.via the TL;DR App

no story

Written by wagslane | Founder of Boot.dev. Whining about coding sins since 2011. Committing coding sins for the same.
Published by HackerNoon on 2020/01/16