[size=medium]The with statement is used to temporarily modify the scope
chain. It has the following syntax:
This statement effectively adds object to the front of the scope chain, executes statement , and then
restores the scope chain to its original state.
Despite its occasional convenience, use of the with statement is frowned upon. JavaScript code that uses
with is difficult to optimize and may therefore run more slowly than the equivalent code written without
the with statement. Furthermore, function definitions and variable initializations within the body of a with
statement can have surprising and counterintuitive behavior. For these reasons, it is recommended
that you avoid the with statement.[/size]
chain. It has the following syntax:
with (object) statement
This statement effectively adds object to the front of the scope chain, executes statement , and then
restores the scope chain to its original state.
Despite its occasional convenience, use of the with statement is frowned upon. JavaScript code that uses
with is difficult to optimize and may therefore run more slowly than the equivalent code written without
the with statement. Furthermore, function definitions and variable initializations within the body of a with
statement can have surprising and counterintuitive behavior.
发表评论
-
Extending Built-in Types
2009-01-08 13:55 732The Function.apply( ) method is ... -
Breakpoints using closures
2009-01-07 13:43 878// // This function implements ... -
Private properties with closures
2009-01-07 13:13 775// // This function adds proper ... -
Constructor Functions
2009-01-07 00:42 783the new operator creates a new ... -
Functions as Methods
2009-01-07 00:39 813When a function is invoked as a ... -
The callee Property
2009-01-07 00:02 671In addition to its array elemen ... -
Variable-Length Argument Lists: The Arguments Obje
2009-01-06 23:06 798The Arguments object has one ve ... -
Function Literals
2009-01-06 21:50 708Although function literals crea ... -
Nested Functions
2009-01-06 21:09 773Nested functions may be defined ... -
Deleting Array Elements
2009-01-05 22:11 580The delete operator sets an arr ... -
Reading and Writing Array Elements
2009-01-05 22:00 783Note that array indexes must be ... -
The valueOf() Method
2009-01-05 18:05 756... -
The toLocaleString() Method
2009-01-05 18:02 866In ECMAScript v3 and JavaScript ... -
The constructor Property
2009-01-05 17:51 797[size=medium]Since constructor ... -
the empty statement
2009-01-05 00:29 796[size=medium]When you intention ... -
try/catch/finnaly
2009-01-05 00:17 898If control leaves the try bloc ... -
throw
2009-01-04 23:56 698The tHRow statement has the fol ... -
return
2009-01-04 23:52 822If a function executes a return ... -
functions
2009-01-04 23:48 808[size=medium]Technically speaki ... -
Labels
2009-01-04 23:01 716Label names are distinct from v ...
相关推荐
Focusing on implementation rather than theory, 'Statistical Computing with R' serves as a valuable tutorial, providing examples that illustrate programming concepts in the context of practical ...
with the Invariant Sections being “Free Software” and “Free Software Needs Free Documentation”, with the Front-Cover Texts being “A GNU Manual,” and with the Back-Cover Texts as in (a) below. ...
根据提供的信息,我们可以总结并详细解释与“debugging_with_gdb(中文版pdf)”相关的知识点。这份文档似乎是一份关于使用 GDB(GNU Debugger)进行调试的手册或指南的中文版 PDF 文件。GDB 是一个非常强大的开源调试...
Mobile App Development with Ionic 2: Cross-Platform Apps with Ionic, Angular, and Cordova by Chris Griffith English | 10 Apr. 2017 | ASIN: B06Y5Q24B2 | 310 Pages | AZW3 | 2.93 MB Learn how to build ...
Working code and data for Python solutions for each test, together with easy-to-follow Python examples, can be reproduced by the reader and reinforce their immediate understanding of the topic. With ...
实际上,Python 提供了 with 语句来管理资源关闭。比如可以把打开的文件放在 with 语句中,这样 with 语句就会帮我们自动关闭文件。 with 语句的语法格式如下: with context expression [as target(s)]: with ...
Mastering Text Mining with R English | 5 Jan. 2017 | ISBN: 178355181X | 258 Pages | AZW3/MOBI/EPUB/PDF (conv) | 24.8 MB Key Features Develop all the relevant skills for building text-mining apps ...
CVPR 2022 Image Dehazing Transformer with Transmission-Aware 3D Position Embedding 源代码,很有学习价值,大佬任文琦团队的最新去雾杰作,从3D定位的角度去思考去雾。CVPR 2022 Image Dehazing Transformer ...
苹果登录Sign in with Apple官方英文文档 Sign in with Apple是苹果公司在2019年WWDC大会上发布的一项新产品,旨在提供一种安全、简洁的登录方式。苹果公司要求,从iOS 13开始,任何新应用程序都必须提供Sign in ...
computer vision with enough understanding of the underlying theory and algorithms to be a foundation for students, researchers, and enthusiasts. The Python programming language, the language choice of...
firstly, we focus on detailed coverage of deep learning (DL) and transfer learning, comparing and contrasting the two with easy-to-follow concepts and examples. The second area of focus is real-world...
Title: Applied Numerical Methods with MATLAB for Engineers and Scientists, 4th Edition Author: Steven Chapra Length: 720 pages Edition: 4 Language: English Publisher: McGraw-Hill Education Publication...
Manning出版 Java Persistence With Hibernate 第二版 清晰pdf Hibernate, an open source project that is almost 15 years old. In a recent poll, Hibernate was among the top five tools used by many Java ...
【MSDN原版】Windows 7 with SP1各版本下载 Windows 7 Ultimate with Service Pack 1简体中文旗舰版: Windows 7 Ultimate with Service Pack 1 (x86) - DVD (Chinese-Simplified) : 下载地址(以下下载地址请右击...