mygaochunming

Results 27 comments of mygaochunming

@creeperyang 我看到nextTick的这种用法: > var http = require('http'); > > function compute() { > // 执行一个cpu密集的任务 > // ... > process.nextTick(compute); > } > > http.createServer(function(req, res) { > res.writeHead(200, {'Content-Type':...

@creeperyang 我上面那段代码摘自http://www.cnblogs.com/lengyuhong/archive/2013/03/31/2987745.html 二. cpu高密集代码段 这里岂不是死循环,即文章中说的“假死”。

@Junx123 这个是作用域链的问题,推荐一篇文章: http://bubkoo.com/2014/06/01/ecma-262-3-in-detail-chapter-4-scope-chain/

@youngwind 你好,关于你例子中的“寄生式继承”,代码是自己写的吗?myCar instanceof Car 返回false,因为在这个过程中myCar的__proto__已经是Vehicle的prototype了。不了解寄生式继承,难道寄生式继承就是这个样子吗?有什么存在的价值??

@Ma63d 看来有些东西就得深入的研究。这篇文章看了2天,因为刚接触js不久,所以google了好长时间。虽然还有些地方不太明白,es5及以下无法完美继承array应该是明白了。 不过,在测试的过程中,我发现你例子中的几个问题: 1、function FakeArray() { return Father.apply(this,arguments); } Father.apply本身就返回undefined,即使return了对new操作符也不起作用,为什么还要加return,有我还不了解的地方吗? 2、 function fakeArray(){ let a = Array.apply(null,arguments) a.__proto__ = fakeArray.prototype a.constructor = fakeArray return a } 这个地方为什么还有a.constructor=fakeArray这句,起到什么作用? 请不吝赐教,谢谢!

@Ma63d 非常感谢您的回答,但是关于第二点,我测试了一下,结果: ![image](https://cloud.githubusercontent.com/assets/21029140/24135551/6228021e-0e45-11e7-8ee0-095c6656ad61.png) 因为有了:fakeArray.prototype.constructor = fakeArray和a.__proto__ = fakeArray.prototype,是不是就已经完成了将a的constructor指向fakeArray了? a.constructor = fakeArray,貌似是在a上增加了个constructor,而不是在__proto__上。 是我哪里还没有理解透彻吗?

我靠,坑! @youngwind vue的data本身就能监听数据变化,那么watch的作用是不是就是自定义handle函数,换句话说watch就是去订阅数据的变化。

按照上面的方法安装了vs2015,上面那个问题解决了,不过又有新的问题: ![image](https://user-images.githubusercontent.com/21029140/44141141-d3989c68-a0ae-11e8-8b63-e7bf1b9e71f1.png) 我装vs2017试试

安装了vs2017又报这个错误: ![image](https://user-images.githubusercontent.com/21029140/44141685-72fa5d4a-a0b0-11e8-84b6-74dd540e83d2.png) ………………

![image](https://user-images.githubusercontent.com/21029140/44256409-ad5b1d80-a23b-11e8-8869-095f74ae6a19.png)