Challenge: Find a Name
Swipe to start coding
Practice searching arrays by checking if a specific name exists in a list of registered users. Complete the NameExists function so that it returns true if the targetName is found in the users array, and false otherwise.
To complete this task, follow these steps:
- Loop through each element in the
usersarray. - Compare each element with the
targetName. - If a match is found, return
true. - If the end of the array is reached without finding a match, return
false.
Løsning
Tak for dine kommentarer!
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Can you explain this in simpler terms?
What are the main benefits or drawbacks?
Can you give me a real-world example?
Awesome!
Completion rate improved to 3.57
Challenge: Find a Name
Stryg for at vise menuen
Swipe to start coding
Practice searching arrays by checking if a specific name exists in a list of registered users. Complete the NameExists function so that it returns true if the targetName is found in the users array, and false otherwise.
To complete this task, follow these steps:
- Loop through each element in the
usersarray. - Compare each element with the
targetName. - If a match is found, return
true. - If the end of the array is reached without finding a match, return
false.
Løsning
Tak for dine kommentarer!
single