Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript exercise for-loop. #2614

Open
MarcoL10 opened this issue Apr 21, 2022 · 5 comments
Open

Javascript exercise for-loop. #2614

MarcoL10 opened this issue Apr 21, 2022 · 5 comments

Comments

@MarcoL10
Copy link

I have a problem with the exercise for-loop with JavaScripting. I mean I got the right result but just I don't understand why the result is 45. Can someone gently explain it to me ? How total become 45 ? Thanks in advance

@flicksuper
Copy link

i have the same problem, what does it mean?

@Orevic64
Copy link

I can’t do it, how do I do it?

@Waden03
Copy link

Waden03 commented May 31, 2022

same problem

@mzgdev
Copy link

mzgdev commented Sep 10, 2022

Hello people, if you have the correct result, your codes are something like this:

let total = 0
let limit = 10

for(let i = 0; i < limit; i++){
  total = total + i
}       

console.log(total) 

for each repetition, the previous value of the variable i is added
for i between 0 and 10 the result is:
0+1+2+3+4+5+6+7+8+9 = 45

@Esme6969
Copy link

have no clue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants