+ 2
Easy way to range -> array and array -> range?
I'm doing some tests on get range information and set it to an array's content to use it through different functions. Also, I'm looking to easy way to convert the content of an array into a range. My question is because is tricky to know how to write it, Maybe an array is 1-dimensional and a range is 2-dimensional? There's something I can't understand clearly on this, thanks!
2 Respuestas
+ 1
// do you want to generate a range of values in an array ?
var aSequence = [...Array(10).keys()];
console.log(aSequence);
// construct a sequential array num to num
var bSequence = [...Array(10).keys()].slice(4);
console.log(bSequence);
+ 1
Thanks, I'll try!