i want to loop through an array and after looping through the array I should be able to select an item from the array with an input function
I tried using the for loop and if statements to call a variable from the array it didn’t work. I wanted to use the if statement as an input to help select an item from the array after looping
The answer can change depending on the language you are using, be sure to specify that give sample code. I do usually loop if statements in Java and it works. You sure you don't have a tipo in your code?
In Javascript you can use the array.filter() function to filter the array to the condition you are specifying:
Hope this answers your question.