# iteration result

[JS](..)⟩ [iteration]() ⟩ iteration result

{% hint style="success" %}
object with <mark style="color:purple;">`value`</mark> <mark style="color:yellow;">**/**</mark> <mark style="color:purple;">`done`</mark> <mark style="color:yellow;">**properties**</mark> that holds the <mark style="color:yellow;">**result of**</mark>**&#x20;**<mark style="color:orange;">**each step**</mark> of the iteration.

```javascript
{ value: 1, done: false }    // iteration result example
```
{% endhint %}

{% tabs %}
{% tab title="⭐️ 重點" %}
{% hint style="success" %}
such an object is said to be <mark style="color:yellow;">**implementing**</mark> the <mark style="color:purple;">**IteratorResult**</mark> <mark style="color:yellow;">**interface**</mark>.
{% endhint %}

{% hint style="info" %}
if a <mark style="color:yellow;">**result**</mark> <mark style="color:red;">**without**</mark> either <mark style="color:yellow;">**value**</mark> or <mark style="color:yellow;">**done**</mark> is returned, it's effectively equivalent to：

```javascript
{ done: false, value: undefined }
```
{% endhint %}
{% endtab %}

{% tab title="📘 手冊" %}
* [iterator protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)
{% endtab %}
{% endtabs %}
