为什么此代码不起作用?以及如何使其工作?

时间:2019-05-31 04:01:32

标签: javascript do-while

确定要使“ y”赶上“ z”所需的步骤。

<div contenteditable>Click here and paste, you can even paste images</div>

1 个答案:

答案 0 :(得分:0)

var z = 50;
var y = 1;
function test(z,y){
    z++;
    y=y+2;
    console.log(z,y,'try');
    if(y>z){
        console.log(z,y,'you do it');
        return false;
    }else{
        test(z,y);
    }
}
test(z,y);