0

I'm trying to create a function in JavaScript that given a string will return an array of all possible combinations of the numbers. e.g for the string 216789 it would return: 2 1 6 7 8 9 21 16 17....

but i want output like that: [22,21, 26, 27, 28, 29,11, 12, 16,17,18,19,62,61,66,67,68,69,71,71,76,77,78,79,82,81,86,87,88,89,92,91,96,97,98,99]

if the user enter 1234 [this is four digit number then total possibilities 4 * 4 = 16] So, I want the output of all possibilities in array form

André
  • 1,602
  • 2
  • 12
  • 26

0 Answers0