阵列长度问题
我在这个脚本上有问题. 通常是脚本 工作和警报的数组长度为9.但是,每隔一段时间 阵列长度为8,自然而然的输出是错误的. 但是看到 当我在循环中使用dis/8时,阵列长度如何为8? var dis = myline.distance(); var fresnelhi = []; var fresnello = []; VAR Height二夫人; var minheight; var Slope = height -diff/dis; var freq = document.getElementById(" freq1").值; wl = .3/freq; 对于(s = 0; s <= dis; s = s+(dis/8)){ var IntervalHeight =(斜率*s) + minheight; var点= wl*s*(dis-s)/dis; Freshi =(IntervalHeight + Math.sqrt(points))/10; fresnelhi.push(Freshi); freslo =(IntervalHeight -Math.sqrt(points))/10; fresnello.push(Freslo); } 警报(fresnello.length)