JavaScript also plays a major role. Next I will introduce the advanced knowledge of JavaScript.
Use the. Operator
Var count = 0; varaddCount = function () {count ++ ;};}; functionooTest () {// generate an object based on class name reflection, only know Book, the parameter "wang" var book = reflect ("Book", ["wang"]); alert (book. getName (); // determines whether an object has a certain attribute. // The hasOwnProperty method can only determine the attributes directly defined on the object, var bool = book cannot be directly determined for inherited attributes. hasOwnProperty ("name"); alert (bool); // an alternative method is required for the inherited attributes such as getName to be judged as var bool2 = book. hasProperty ("getName"); alert (bool2); // traverses all attributes on the book object for (varpro Name in book) {alert (book [proName]) ;}// if we need to obtain an object, all attribute values are not the function attribute varproArray = []; for (varproName in book) {vartemp = book [proName]; if (typeof temp! = "Function") {proArray. push (proName) ;}} alert (proArray );