Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Latest commit

 

History

History
17 lines (11 loc) · 375 Bytes

prefer-while.md

File metadata and controls

17 lines (11 loc) · 375 Bytes

prefer-while

🔧 fixable

When only the condition expression is defined in a for loop, and the initialization and increment expressions are missing, a while loop should be used instead to increase readability.

Noncompliant Code Example

for (;condition;) { /*...*/ }

Compliant Solution

while (condition) { /*...*/ }