gau*_*ngh 19 javascript jquery
var points = [{ x: 75, y: 25},{ x: 75+0.0046, y: 25}];
Run Code Online (Sandbox Code Playgroud)
我将如何迭代这一点.我想首先打印x和y值,然后打印第二个和soo ....
Pra*_*lan 10
使用Array#forEach方法进行数组迭代.
var points = [{
x: 75,
y: 25
}, {
x: 75 + 0.0046,
y: 25
}];
points.forEach(function(obj) {
console.log(obj.x, obj.y);
})Run Code Online (Sandbox Code Playgroud)