我从index.js查看文档源文件this library。我检查了jshint中的代码,并且有一个警告说:
期望一个赋值或函数调用,而是看到一个表达式。
s = (Math.sqrt((x * x) + (y * y)) / r) * 100;
为什么我收到警告,我该如何解决?
答案 0 :(得分:1)
function main() {
var currentTargetHeight = 240;
var e = {clientX: 40, clientY: 50};
var startPoint = { left: 3, right: 4};
var r, x, y, h, s;
r = currentTargetHeight / 2;
x = e.clientX - startPoint.left - r;
y = e.clientY - startPoint.top - r;
h = 360 - ((Math.atan2(y, x) * 180 / Math.PI) + (y < 0 ? 360 : 0));
s = (Math.sqrt((x * x) + (y * y)) / r) * 100;
}
main();