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

What does "one one".replace("one", "two") return?

  1. one two
  2. one one
  3. two two
  4. two oneՃիշտ պատասխան

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

With a plain string search value, replace changes only the first matching occurrence and returns a new string. Replacing both occurrences would require a different search setup, so "two two" is not produced here.

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

Սկսել վարժանքը
Հարց 34: What does "one one".replace("one", "two") return? · JavaScript Fundamentals · Questena