In this post, we will see how to resolve The function should return an array of the first n multiples of the number x
Question:
I don’t understand why my function is not working. I Need help please.
Best Answer:
I think this is what you need.
The thing you were not achieving your desired output is due to the fact you are treating n as an array which is not. You just need to multiply the number x with i (which should be increasing until it becomes equal to n) and push it to the array.
If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com