摘要:
obj.name ==> obj["name"] 底层的自动转化,所以直接写 obj["name"] 效率会高一些 var obj = { name: "zhangsan", age: 12, sex: "male" } console.log(obj.name); // "zhangsan" co 阅读全文
摘要:
闭包解决命名空间污染问题 var init = (function () { var name = "zhangsan", age = 12, sex = "male", _class = 2019 function sayName() { console.log(name); } function 阅读全文
摘要:
连续调用,了解调用主体 var zhangsan = { smoke: function () { console.log("Smoking..."); return this; }, drink: function () { console.log("drinking..."); return t 阅读全文