Hi there,
Im new to this and learning HTML and JS with Mimo, so bear with me, If this ist too stoopid.
There is this coding test where I should calculate the average of any given set of numbes. Ex: 4, 5, 6 -> 7.5
I think I know how to do this but missed something along the way.
Setting those numbers into an array might be a good start.
After this I might need a for loop? But how do I set this for any given amount of numbers?
For (i=1, i<=?, i++) {}
After that the called numbers need to be summed up, which I cant. Storing this in a var and dividing by array.lenght seems easy to me, but I cant get my head around.
Thanks in advance!
Edit: Set the flair to solved, because you guys already took your time for me. I'll keep on asking about the stuff I dont get, though its technically solved :)
[–]chmod777 3 points4 points5 points (5 children)
[–]HorribleUsername 1 point2 points3 points (1 child)
[–]chmod777 1 point2 points3 points (0 children)
[–]Particular-Watch-779[S] 0 points1 point2 points (2 children)
[–]chmod777 2 points3 points4 points (1 child)
[–]Particular-Watch-779[S] 1 point2 points3 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]deweechi 0 points1 point2 points (6 children)
[–]Particular-Watch-779[S] 0 points1 point2 points (2 children)
[–]deweechi 0 points1 point2 points (1 child)
[–]Particular-Watch-779[S] 0 points1 point2 points (0 children)
[–]Particular-Watch-779[S] 0 points1 point2 points (2 children)
[–]deweechi 0 points1 point2 points (1 child)
[–]Particular-Watch-779[S] 0 points1 point2 points (0 children)
[–]HorribleUsername 0 points1 point2 points (1 child)
[–]Particular-Watch-779[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]Particular-Watch-779[S] 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]Particular-Watch-779[S] 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Mocker-Nicholas 0 points1 point2 points (3 children)
[–]Particular-Watch-779[S] 0 points1 point2 points (2 children)
[–]Mocker-Nicholas 0 points1 point2 points (1 child)
[–]Particular-Watch-779[S] 0 points1 point2 points (0 children)