摘要: 提问: person1.__proto__ 是什么? ​Person.__proto__ 是什么? Person.prototype.__proto__ 是什么? Object.__proto__ 是什么? Object.prototype__proto__ 是什么? 答案:第一题:因为 perso 阅读全文
posted @ 2017-11-21 12:10 来亦何哀 阅读(163) 评论(0) 推荐(0) 编辑
摘要: (至少)有两种方法可以做到: 方法1: 在JavaScript中,函数可以提供到 arguments 对象的访问,arguments 对象提供传递到函数的实际参数的访问。这使我们能够使用 length 属性来确定在运行时传递给函数的参数数量。 如果传递两个参数,那么只需加在一起,并返回。 否则,我们 阅读全文
posted @ 2017-11-21 12:00 来亦何哀 阅读(361) 评论(0) 推荐(0) 编辑
摘要: var list = readHugeList(); var nextListItem = function() { var item = list.pop(); if (item) { // process the list item... nextListItem(); } }; 潜在的堆栈溢出 阅读全文
posted @ 2017-11-21 11:56 来亦何哀 阅读(433) 评论(0) 推荐(0) 编辑