Thursday , September 19 2024

We have declared an array of animals: let animals = [“canary”, “dog”, “cat”];. Then we call the method animals.push(“hamster”);. As a result, the animals array will look like this:

Questions BankCategory: JavaScript Essentials 1We have declared an array of animals: let animals = [“canary”, “dog”, “cat”];. Then we call the method animals.push(“hamster”);. As a result, the animals array will look like this:
We have declared an array of animals: let animals = ["canary", "dog", "cat"];. Then we call the method animals.push("hamster");. As a result, the animals array will look like this:

  • ["canary", "dog", "cat"]
  • ["hamster", "canary", "dog", "cat"]
  • ["canary", "dog", "cat", "hamster"]
  • ["hamster"]

More Questions: JavaScript Essentials 1 – JSE1: Final Test