QuestenaՎարժանք, որը ցույց է տալիս՝ ինչ կրկնել հաջորդիվ
Հարց 36

A for...of loop processes a string containing one supplementary Unicode code point encoded as a surrogate pair. How many loop values represent that code point?

  1. Two, one for each code unit
  2. One, for the combined code pointՃիշտ պատասխան
  3. Zero, because it is not basic Unicode
  4. A runtime-dependent number

Բացատրություն

String iteration combines the surrogate pair into one Unicode code point, so one loop value represents it. Counting two would copy the code-unit behavior of length or bracket positions into a code-point iterator.

Շարունակեք այս թեստով

Սկսել վարժանքը
Հարց 36: A for...of loop processes a string containing one… · JavaScript Fundamentals · Questena