I want to generate an array of all the permutations for a time-series. Suppose the numbers can be 0, 5, 10, 25 and the first permutation is [0,0,0,0,0,0,0]. The next permutation can be [0,0,0,0,0,0,5] and so on up until [25,25,25,25,25,25,25]. There should be 4^6 = 4096 permutations in this case because there are 4 numbers and 7 slots.
Can someone please help me understand how to get started on this problem? I want to write this in javascript. Thanks for your consideration.