Discuss / JavaScript / 发现一个不能正常显示的地方

发现一个不能正常显示的地方

Topic source

烛龙一现

#1 Created at ... [Delete] [Delete and Lock User]

function test(resolve, reject) { var timeOut = Math.random() 2; log('set timeout to: ' + timeOut + ' seconds.'); setTimeout(function () { if (timeOut < 1) { log('call resolve()...'); resolve('200 OK'); } else { log('call reject()...'); reject('timeout in ' + timeOut + ' seconds.'); } }, timeOut 1000); }

J微风幽兰

#2 Created at ... [Delete] [Delete and Lock User]

少年你的“2”前面Math.random()后面掉了一个乘号*呀。


  • 1

Reply