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

A variable a refers to an array. Variable b is assigned a, with no new array created. What is a === b?

  1. false because arrays are mutable
  2. undefined because arrays lack equality
  3. true because both refer to one objectՃիշտ պատասխան
  4. true only when the array is empty

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

Both variables refer to the same array object, so strict equality produces true. Equal-looking but separately created arrays would fail this test because object strict equality depends on shared identity.

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

Սկսել վարժանքը
Հարց 15: A variable a refers to an array. Variable b is assigned a,… · JavaScript Fundamentals · Questena