JavaScript Refresher and Detailed Study - Part 3
Last updated on 4 Sep 2026 Post series: Prev Part (2) Contents First look at iterable in javascript.info Quick look at MDN: Iterators and generators; Did not see iterators and generators in React JS codebases I saw Why this. is needed in the iterable examples of javascript.info What's needed to make an object iterable? Javascript.info range iterator case does not really iterate over range object Vanilla JS program could leverage run to completion guarantee but that may not be recommended in React JS programs Dangers of merging iterator into the iterable JavaScript surrogate pair (e.g. most emojis) causes length property of string to give inaccurate string length; Array.from() fixes it Vast majority of apps still use standard .length property; Array.from() is slower and .length is good enough for most use cases Modern C++ std::string too faces the same issue; Special functions provide solution but at performance cost Using break in loop is acceptable as guard c...