S-array icon indicating copy to clipboard operation
S-array copied to clipboard

Adding a Symbol.iterator property

Open Qix- opened this issue 4 years ago • 0 comments

Hey Adam,

would it be possible to add a Symbol.iterator property for better interop?

For example, with SArrays the following fails with a .map() is not iterable error:

const arr = SArray([1, 2, 3, 3, 4, 5]);
const set = new Set(arr.map(i => i > 2));

Thanks!

Qix- avatar Jun 18 '21 07:06 Qix-