Skip to content
Advertisement

Finding elements in array using for loop

JavaScript

I am trying to add Scanner inputs into an array and I am trying to search for the element in an array using a for loop. The for loop looped through all the elements and print out “Not here” when names[i] is not equal to the Scanner input. How do I fix this issue ?

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement