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

For a nonempty array named items, what does items[items.length] produce?

  1. The final element
  2. A RangeError
  3. The array's length
  4. The value undefinedՃիշտ պատասխան

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

The last valid index is one less than the array's length, so the index equal to length is just beyond the end. Reading that absent element yields undefined; an ordinary out-of-range array read does not itself throw an exception.

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

Սկսել վարժանքը
Հարց 116: For a nonempty array named items, what does… · JavaScript Fundamentals · Questena