js: range | return populated array from 0 to n