javascript - How do I get the triangle array outside so that I can use it -


i storing id's array. array correctly populated, not able log outside nor use it. confused. here code,

javascript

function storetriangle() {     var triangle = [];     return function storepolygons() {         (var = 0; < 31; i++) {             triangle[i] = s.select("#triangle36_" + (224 - i) + "_");         }     };     storepolygons(); }; var polygons = storetriangle(); polygons(); 

function storetriangle() {          var triangle = [];          return function() {              (var = 0; < 31; i++) {                  triangle[i] = s.select("#triangle36_" + (224 - i) + "_");              }            return triangle;          };      };      var polygons = storetriangle();      var triangle=polygons();  console.info(triangle)


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -