Using JavaScript operators withhas long been considered bad coding practice and has been recommended against.
This page indicates that it is withoutdated and will cause an error in strict mode, my browser displays an error message when used within strict mode, and the Google Closure compiler generates an error indicating that strict mode does not allow with:
JSC_USE_OF_WITH: The with statement cannot be used in strict mode.
According to MDN , it is recommended that you avoid using it with, but today it seems to be practically not recommended , and it does not seem to be included in the examples of strict mode code restrictions .
This looks somewhat controversial and confusing. So, is it withreally outdated or not?
source
share