+ 1
Alright, well you see the input part, there are 4 numbers, where ... First number represents number of levels a player had passed. Successive numbers represents the scores, to be accumulated Taking the task Description ... 3 // number of levels 1 // score on 1st level 4 // score on 2nd level 8 // score on 3rd level Number of scores to be read in will depend on fhe first input (number of levels passed) Our task is tio accumulate the scores, in this case 1 + 4 + 8 which results in 13 And if it was the Array::reduce() that you wished to get to know better, then you can read more about it here ... https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce
29th Nov 2022, 7:28 AM
Ipang
+ 2
Why you commented all lines that reads user input? isn't that part of the task? Here I see you hardcode the numbers, while the code should instead be reading user input and use them. Wdym "get codes in details"?
28th Nov 2022, 3:43 PM
Ipang