formar una matriz de i a j javascript

Array.from({ length: to-from+1 }, (_, i) => from + i)
Elegant Elk