based on the answer of this question I tried to make this code. I know it\'s not exactly the same, but from what I know, you don\'t define length of arrays in javascript, so