The for loop only stops if the condition is not met. In this case, i = 5 after it is increased inside the last loop. Hence, it breaks out of the condition. Therefore i is 5 when it is printed.
More Related Contents:
- ++someVariable vs. someVariable++ in JavaScript
- post increment vs pre increment – Javascript Optimization
- What is a method that can be used to increment letters?
- I want to make first option in dropdown to display as a placeholder
- Scroll Function working in reverse order [closed]
- Alternative to string.split
- How to force the browser to reload cached CSS and JavaScript files
- getMonth in javascript gives previous month
- Alternative to a million IF statements
- Set custom HTML5 required field validation message
- When to use the JavaScript MIME type application/javascript instead of text/javascript?
- jQuery $(“#radioButton”).change(…) not firing during de-selection
- Styling [duplicate]
- What is the meaning of an Underscore in javascript function parameter?
- Client Routing (using react-router) and Server-Side Routing
- pure javascript to check if something has hover (without setting on mouseover/out)
- Where is d3.svg.diagonal()?
- Custom exception type
- Angular 2 Material 2 datepicker date format
- Getting the value from a TinyMCE textarea
- Create a hidden field in JavaScript
- Put a Delay in Javascript
- Replace function not replacing [duplicate]
- Include Arabic characters in JavaScript regular expression?
- How to set custom validation messages for HTML forms?
- Pass a variable from content script to popup
- Use RegExp to match a parenthetical number then increment it
- Javascript copy array to new array [duplicate]
- Is My Page Being Loaded from the Browser Cache?
- Renaming object keys recursively