我正在将一些ID存储到数组中。数组已正确填充,但我无法将其记录到外部也无法使用它。我有点困惑。这是我的代码,
的JavaScript
function storeTriangle() {
var triangle = [];
return function storePolygons() {
for (var i = 0; i < 31; i++) {
triangle[i] = s.select("#triangle36_" + (224 - i) + "_");
}
};
storePolygons();
};
var polygons = storeTriangle();
polygons();
答案 0 :(得分:1)
function storeTriangle() {
var triangle = [];
return function() {
for (var i = 0; i < 31; i++) {
triangle[i] = s.select("#triangle36_" + (224 - i) + "_");
}
return triangle;
};
};
var polygons = storeTriangle();
var triangle=polygons();
console.info(triangle)
&#13;