# Avoid calling a function in a for loop declaration (`@greenpoint/no-function-call-in-for-declaration`)

⚠️ This rule _warns_ in the ✅ `recommended` config.

<!-- end auto-generated rule header -->

## Rule Details

This rule aims to avoid the use of function in the declaration of a for loop for optimization purposes.

## Examples

Examples of **non-compliant** code for this rule:

```js
for (let index = 0; index < getSize(); index++) {
  const element = array[index];
}
```

Examples of **compliant** code for this rule:

```js
let size = getSize();
for (let index = 0; index < size; index++) {
  const element = array[index];
}
```
