[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 725The Function.apply( ) method is ... -
Breakpoints using closures
2009-01-07 13:43 869// // This function implements ... -
Private properties with closures
2009-01-07 13:13 760// // This function adds proper ... -
Constructor Functions
2009-01-07 00:42 760the new operator creates a new ... -
Functions as Methods
2009-01-07 00:39 805When a function is invoked as a ... -
The callee Property
2009-01-07 00:02 664In addition to its array elemen ... -
Variable-Length Argument Lists: The Arguments Obje
2009-01-06 23:06 787The Arguments object has one ve ... -
Function Literals
2009-01-06 21:50 702Although function literals crea ... -
Nested Functions
2009-01-06 21:09 767Nested functions may be defined ... -
Deleting Array Elements
2009-01-05 22:11 567The delete operator sets an arr ... -
Reading and Writing Array Elements
2009-01-05 22:00 763Note that array indexes must be ... -
The valueOf() Method
2009-01-05 18:05 742... -
The toLocaleString() Method
2009-01-05 18:02 851In ECMAScript v3 and JavaScript ... -
The constructor Property
2009-01-05 17:51 789[size=medium]Since constructor ... -
the empty statement
2009-01-05 00:29 786[size=medium]When you intention ... -
try/catch/finnaly
2009-01-05 00:17 890If control leaves the try bloc ... -
throw
2009-01-04 23:56 692The tHRow statement has the fol ... -
return
2009-01-04 23:52 816If a function executes a return ... -
functions
2009-01-04 23:48 790[size=medium]Technically speaki ... -
Labels
2009-01-04 23:01 707Label 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 ...
在Visual Basic (VB)编程语言中,`With`语句块是一种非常实用的语法结构,它允许程序员在一段代码中多次引用同一个对象,而无需反复输入对象名。这极大地提高了代码的可读性和效率,尤其是在处理复杂对象或者需要对...
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 ...