js preliminary understanding of the object

for (  attr in obj  ) 

Traversal from object members (attributes) for in

obj.focus ()     // object. The method 
obj.leng        // object. members of the (property) 
obj.onresize // object. event
obj.name = "John Doe"; // dynamically add members (properties) is a target-specific js
set with default object for the statement. 
Alert () // front is no need to belong to the object because the global window 
with (object) {
      // window.alert (); // originally so because with the default object disposed 
    object.alert (); // now the object point window object instead 
}

 

Guess you like

Origin www.cnblogs.com/zong-zong/p/11470324.html