So I have a certain amount of people standing in line. I want to give each one of them a candy but each next person in line should get more candies. For example: 1st gets 1, 2nd gets 2, 3rd gets 3 and so on.
And what I need is to get total amount of candies given the amount of people.
Here's what I have so far (and I know it's totaly wrong but I'm lost):
function getTotalAmount(people) {
let candy;
for (candy = 0; true; candy++) {
return candy;
}
}