摘要:
function Father () { } Father.prototype.lastName = "Zhang"; function Son () { } Son.prototype = Father.prototype; function F () {} function inherit (T 阅读全文
摘要:
Person.prototype.name = "sunny"; function Person () { } var person = new Person(); Person.prototype = { name : "cherry" } Person的name最终为“sunny”,原因如下: 阅读全文
摘要:
var obj = { name : "XiaoQi", sex : 'female', age : 18, stature : 160, weight : 90, apple : function () { console.log('I am eating apple!!!'); this.wei 阅读全文
摘要:
function test () { var arr = []; for (var i = 0; i < 10; i ++) { arr[i] = function () { document.write(i + " "); } } return arr; } var myArr = test(); 阅读全文