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

Which statements about bracket property access are true? Select all that apply.

  1. If key holds the string name, object[key] accesses the name propertyՃիշտ պատասխան
  2. object.key always accesses the same property as object[key]
  3. Changing the value of key can make object[key] select another propertyՃիշտ պատասխան
  4. The expression inside brackets must be a string literal

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

The expression inside brackets is evaluated before property access, so a variable can supply the desired name and changing that variable can select another property. Dot access uses the written identifier literally, so treating object.key as always equivalent is the closest false claim.

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

Սկսել վարժանքը
Հարց 63: Which statements about bracket property access are true?… · JavaScript Fundamentals · Questena