From 08f018c637bd1261558fecaf3998e099298dca14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro?= Date: Thu, 27 May 2021 19:47:25 +0200 Subject: [PATCH] `makeIterator()` return an `iterable` object This fixes #12 and allow to use `for..of` and array spread. --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 818cf07..dd9b3d4 100644 --- a/index.js +++ b/index.js @@ -200,6 +200,9 @@ var Multimap = (function() { var nextIndex = 0; return { + [Symbol.iterator](){ + return this + }, next: function(){ return nextIndex < iterator.length ? {value: iterator[nextIndex++], done: false} :