I have seen this question and from what I have worked on it contained the answer but unfortunately it used Python instead of Javascript. So I would like to ask an similar question.
I have an Javascript array which follows this format:
[[1,2,3],[4,5,6,7,8],[9,10]]
The function I am looking for should turn this array and pad all of them with zeros until they have all reached the max length (for this example as shown above it is 5). The function should output an array with this format:
[[1,2,3,0,0], [4,5,6,7,8],[9,10,0,0,0]]