After creating a customized function that generates an array of numbers, I encountered an issue where the array is not accessible outside the function itself.
function customArrayGenerator (length, order){ // length = array length; order = integer order of magnitude
var numbers = new Array();
var num;
var mag;
for (var i = 0; i < length; i++) { // number generator
num = 0;
for (var j = 1; j <= order; j++) { // adding numbers at specified magnitude
mag = Math.pow(10,j);
num = num + Math.random()*mag;
}
numbers[i] = Math.round(num);
}
I'm now wondering how to access and utilize the variable numbers
.