Home > Web Front-end > JS Tutorial > Traversing for in and usage of with in javascript_Basic knowledge

Traversing for in and usage of with in javascript_Basic knowledge

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 16:25:18
Original
1325 people have browsed it

for in loops through the properties of an object

With statement: (Object operation statement)
                   Function: Create a default object for a program

Format:

Copy code The code is as follows:

with(){

                                                                                                                                                                           

        }


Specific example:

Copy code The code is as follows:

/*Running effect:
person.name = Rene Liu
person.gender = female
*/

Do you guys have some understanding of the usage of traversing for in and with in javascript? This is the basis for learning javascript.

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template