• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
+ 3

for loops

Hi everyone, pls why is the output of this loop 10? var x = 2; for(i = 0; i < 4; i++) { x += 2; } document.write(x);

javascript
28th May 2021, 3:03 PM
Lara
Lara - avatar
2 Answers
+ 5
https://code.sololearn.com/WSb9uaWyk7z8/?ref=app
28th May 2021, 3:28 PM
JaScript
JaScript - avatar
+ 2
Thank you :)
28th May 2021, 3:43 PM
Lara
Lara - avatar

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
Decorators in python.
2 Votes
How to install Bcrypt here
1 Votes
Codegames
1 Votes
ŰčÙŰ§ÙƒÙ… ŰšŰșيŰȘ Ù†ŰłÙˆÙ„ÙƒÙ… ÙƒÙŠÙŰ§ŰŽ Ù†ŰŻÙŠŰ± ÙƒÙˆŰŻ ويكون Ű”Ű­ÙŠŰ­ŰŸ
1 Votes
What is happening with sololearn
1 Votes
CAN I FOLLOW YOU🙏🙏!!!
2 Votes
Can sololearn have multiple inpus&outputs?
3 Votes
CAN ANYONE TELL ME WHAT TO LEARN NEXT AFTER ADVANCED PYTHON CONCEPTS
1 Votes
Programming language learning
0 Votes
How can I add images to my website
0 Votes