1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > js中报:TypeError: (intermediate value) is not a function错误

js中报:TypeError: (intermediate value) is not a function错误

时间:2022-05-20 14:14:50

相关推荐

js中报:TypeError: (intermediate value) is not a function错误

js中报:TypeError: (intermediate value) is not a function错误

let mouse = c.getOffset(canvas); //这里不加分号会报错,提示c.getOffset is not a function// 前面要加分号,后面也要加,这里和上边都忘记分号时报错(function drawFrame() {window.requestAnimationFrame(drawFrame);ctx.clearRect(0,0,W,H);x = mouse.x - hx;y = mouse.y - hy;ball.x = x;ball.y = y;ball.render(ctx)})()

//通过函数构造器定义function drawSystem(){} // 这里不用加分号//通过函数表达式定义, 此时我们认为该函数是一个变量var ball = function(){}; // 这里一定要加分号,不然在后面紧跟一个如下形式的函数封装时会报错(intermediate value)(...) is not a function

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。