with
This feature is discouraged — JavaScript strict mode prohibits the with statement.
Consider using Destructuring instead.
For more information, see: https://tc39.es/ecma262/multipage/ecmascript-language-statements-and-declarations.html#sec-with-statement
The with JavaScript statement adds a given object to the chain of scopes used to evaluate names.
Status
Discouraged
MDN documentation
Specifications
- ECMAScript® 2026 Language Specification (#sec-with-statement), from TC39 (Ecma International).
Browser support
- Chrome 38 Released on 2014-10-07
- Chrome Android 38 Released on 2014-10-08
- Edge 12 Released on 2015-07-29
- Firefox 48 Released on 2016-08-02
- Firefox for Android 48 Released on 2016-08-02
- Safari 10 Released on 2016-09-20
- Safari on iOS 10 Released on 2016-09-13
Usage (according to Chrome Platform Status)
~7.911% of page loads. More data at chromestatus.com.View as JSON | Edit this feature | Report an issue | Web-features entry: source, dist