diff --git a/iterator/index.html b/iterator/index.html new file mode 100644 index 0000000..2ba7368 --- /dev/null +++ b/iterator/index.html @@ -0,0 +1,34 @@ + + + + + Title + + + + + + \ No newline at end of file diff --git a/iterator/iterator.js b/iterator/iterator.js new file mode 100644 index 0000000..58beafb --- /dev/null +++ b/iterator/iterator.js @@ -0,0 +1,11 @@ +// Iterator +class Iterator { + constructor(data) { + this.data = data.values(); + } + + //get next item from the collection + getNext() { + return this.data.next().value; + } +}