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