Andrea Giammarchi (2013-08-27T01:48:25.000Z)
domenic at domenicdenicola.com (2013-09-08T00:18:37.757Z)
one lazy hilarious thought on that though ... On Mon, Aug 26, 2013 at 5:30 PM, Forbes Lindesay <forbes at lindesay.co.uk>wrote: > `String#split` already is iterable because it returns an array. What it > isn't is **lazy**. it's straight forward to make String#split(re) lazy using the `lastIndex` indeed: ```javascript function* lazySplit(str, re) { for (var i = 0; re.test(str); i = re.lastIndex ) yield str.slice( i, re.lastIndex - RegExp.lastMatch.length ) ; yield str.slice(i); } ```