This gist regards some confusion resulting from this StackOverflow question.
Refer to sections 15.5.4.10 and 15.5.4.11 of the spec - page 145ish.
Before any passes, the cursor is at the start of the string:
, " , f , o , o , , b , a , r , " ,
^
lastIndex = 0