MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Statements › for...in
for...in - JavaScript | MDN - MDN Web Docs
The for...in statement iterates over all enumerable string properties of an object (ignoring properties keyed by symbols), including inherited enumerable properties.
W3Schools
w3schools.com › js › js_loop_forin.asp
JavaScript For In
The for...in loop is primarily used for objects to access their property names (keys). for (key in object) { // code block to be executed } key A variable that holds the name (key) of each property during the iterations · object The object ...
Videos
05:45
Learn JavaScript FOR LOOPS in 5 minutes! 🔂 - YouTube
05:46
How to Write and Use For Loops in JavaScript | Beginner’s Guide ...
10:54
#27 For...in loop | JavaScript Full Tutorial - YouTube
03:17
JavaScript Basics - How to use for in loops - YouTube
10:53
#23 JavaScript for..of and for..in Loop | JavaScript for Beginners ...
08:35
JavaScript Tutorial 31 - For in Loop in JavaScript | Programming ...
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Object › entries
Object.entries() - JavaScript - MDN Web Docs
// Using for...of loop const obj = { a: 5, b: 7, c: 9 }; for (const [key, value] of Object.entries(obj)) { console.log(`${key} ${value}`); // "a 5", "b 7", "c 9" } // Using array methods Object.entries(obj).forEach(([key, value]) => { console.log(`${key} ${value}`); // "a 5", "b 7", "c 9" });
W3Schools
w3schools.com › js › js_loop_for.asp
JavaScript for Loop
When let is used to declare the i variable in a loop, the i variable will only be visible within the loop. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
TutorialsPoint
tutorialspoint.com › javascript › javascript_for_loop.htm
JavaScript - For Loop
The syntax of for loop is JavaScript is as follows − · for (initialization; condition; iteration) { Statement(s) to be executed if condition is true }
Mozilla
developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Loops_and_iteration
Loops and iteration - JavaScript - MDN Web Docs - Mozilla
A for loop repeats until a specified condition evaluates to false. The JavaScript for loop is similar to the Java and C for loop. ... The initializing expression initialization, if any, is executed. This expression usually initializes one or more loop counters, but the syntax allows an expression ...
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Statements › for
for - JavaScript | MDN - MDN Web Docs - Mozilla
The for statement creates a loop that consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement (usually a block statement) to be executed in the loop.
Programiz
programiz.com › javascript › for-loop
JavaScript for loop (with Examples)
In JavaScript, the for loop is used for iterating over a block of code a certain number of times or over the elements of an array. In this tutorial, you will learn about the JavaScript for loop with the help of examples.
GeeksforGeeks
geeksforgeeks.org › javascript › for-in-loop-in-javascript
JavaScript For In Loop - GeeksforGeeks
The for...in loop in JavaScript is used to iterate over the enumerable properties of an object.
Published January 22, 2026
SitePoint
sitepoint.com › blog › javascript › how to use the for loop in javascript
For Loop in JavaScript: How to Use the for…in Loop — SitePoint
November 7, 2024 - So, if the value variable in the for...in loop syntax structure we showed above was an array of five items, key would not be guaranteed to be 0 to 4. Some indices might precede others. Details on when this might happen is explained later in this article. In the example below, we’re looping over the following variable arr: const arr = ["JavaScript", "PHP", "Python", "Java"]; for (let key in arr) { console.log(key + ": " + arr[key]) } // Output: // "0: JavaScript" // "1: PHP" // "2: Python" // "3: Java"
TutorialsPoint
tutorialspoint.com › home › javascript › javascript for...in loop
JavaScript - For...in Loop
September 1, 2008 - The for...in loop in JavaScript is used to loop through an object's properties. The JavaScript for...in loop is a variant of the for loop. The for loop can't be used to traverse through the object properties.
Mimo
mimo.org › glossary › javascript › for-loops
JavaScript For Loop: Efficient Iteration in JavaScript
Learn HTML, CSS, JavaScript, and React as well as NodeJS, Express, and SQL ... Master the language of the web. Learn variables, functions, objects, and modern ES6+ features ... Classic for loop: Repeats a block of code a specific number of times. It is commonly used to iterate over an array ...
W3Schools
w3schools.com › js › js_looping.asp
JavaScript Loops
The for...in loop iterates over the enumerable properties of an object. It is typically used for iterating over object keys. for (key in object) { // code block to be executed } A JavaScript for...in statement loops through the properties of ...
DigitalOcean
digitalocean.com › community › tutorials › for-loops-for-of-loops-and-for-in-loops-in-javascript
JavaScript For Loops | DigitalOcean
August 26, 2021 - In this tutorial, we will learn ... elements of the JavaScript programming language. The for statement is a type of loop that will use up to three optional expressions to implement the repeated execution of a code block....
GeeksforGeeks
geeksforgeeks.org › javascript › loops-in-javascript
JavaScript Loops - GeeksforGeeks
The for-in loop iterates over the enumerable keys of an object. ... Example: The below JavaScript program for-in loop iterates over the keys of the person object and prints each key with its corresponding value.
Published January 19, 2026
W3Schools
w3schools.com › jsref › jsref_forin.asp
JavaScript for...in Loop
The for...in statements combo iterates (loops) over the properties of an object.
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-for-loop
JavaScript For Loop - GeeksforGeeks
JavaScript for loop is a control flow statement that allows code to be executed repeatedly based on a condition. It consists of three parts: initialization, condition, and increment/decrement.
Published September 27, 2025