Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Searching for Animals in the Zoo | Section
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
JavaScript Essentials for Beginners - 1768407374405

bookChallenge: Searching for Animals in the Zoo

Taak

Swipe to start coding

Use the includes method to check if certain animals are in a list.

  • Write three if-else conditions to check if the following animals are in the animalsInZoo array: Lion, Zebra, Panda.
  • If the animal is in the zoo, print: "Yay! We have a [animal] in our zoo!", where [animal] is the name of the animal.
  • If the animal is not in the zoo, print: "Oh no! No [animal] in our zoo today.".

As stated in the instructions, you will need three separate pairs of if-else conditions:

if(...) {
  // code
} else {
  // code
}

if(...) {
  // code
} else {
  // code
}

if(...) {
  // code
} else {
  // code
}

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 66
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

close

bookChallenge: Searching for Animals in the Zoo

Veeg om het menu te tonen

Taak

Swipe to start coding

Use the includes method to check if certain animals are in a list.

  • Write three if-else conditions to check if the following animals are in the animalsInZoo array: Lion, Zebra, Panda.
  • If the animal is in the zoo, print: "Yay! We have a [animal] in our zoo!", where [animal] is the name of the animal.
  • If the animal is not in the zoo, print: "Oh no! No [animal] in our zoo today.".

As stated in the instructions, you will need three separate pairs of if-else conditions:

if(...) {
  // code
} else {
  // code
}

if(...) {
  // code
} else {
  // code
}

if(...) {
  // code
} else {
  // code
}

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 66
single

single

some-alt