For this challenge, you will be given an array as the following:
[[3], 4, [2], [5], 1, 6]By definition, the array has elements that's either an integer or an array containing an integer. We can clearly see that this array can reasonably be sorted according to "the content of the elements" as:
[1, [2], [3], 4, [5], 6]Create a function that, given an array similar to the above, sorts the array according to the "content of the elements".
sortIt([4, 1, 3]) ➞ [1, 3, 4]
sortIt([[4], [1], [3]]) ➞ [[1], [3], [4]]
sortIt([4, [1], 3]) ➞ [[1], 3, 4]
sortIt([[4], 1, [3]]) ➞ [1, [3], [4]]
sortIt([[3], 4, [2], [5], 1, 6]) ➞ [1, [2], [3], 4, [5], 6]
sortIt([13, [2000], 1979, 12, [12], 17]) ➞ [12, [12], 13, 17, 1979, [2000]]Elements of the array will be either integers or arrays with a single integer.