walkTo里面为什么要加return
walkTo: function(time, proportionX, proportionY) {
var distX = calculateDist('x', proportionX)
var distY = calculateDist('y', proportionY)
return walkRun(time, distX, distY);
}
//-----------------------------------------------------------------
为什么要在walkRun(time, distX, distY);前面加return,但是如果不加的话就会出现Cannot read property 'then' of undefined的错误,但是如果不加的话,以我单纯的理解就是可以通过startRun方法里返回deferred,好像不需要在walkRun(time, distX, distY)前面加return,求大神讲解