# Take the first N elements of an iterator

* take

* `take` creates a new iterator from the first `n` element of any iterator.
* It can be used on an infinite iterator as well.
* The example we have here does not add value over just using a range, but for every other iterator it will make sense.

{% embed include file="src/examples/iterators/iterator-take/src/main.rs" %}

{% embed include file="src/examples/iterators/iterator-take/out.out" %}


