for
for is a JavaScript function in the Statements category. Loop construct. The syntax is for (init; cond; inc) { }. A typical example: for (let i=0; i<3; i++) { }. A close sibling is if...else, which conditional execution. A close sibling is for...of, which iterates over values. A close sibling is while, which loops while true. A close sibling is switch, which match against cases. More about this category: Statements and declarations. Related Statements methods: if...else, for...of, while, switch, try...catch, throw, const, let. This page is part of the free JS Reference documentation covering 1027+ methods, each with syntax, parameters, return values, examples, and common pitfalls. You can try for immediately in the JavaScript playground, look up unfamiliar terms in the glossary, or return to the JS Reference homepage.