I am a newbie to JavaScript, and now trying to find a way to filter a string array based on a boolean array.
Given
arr1 = ["Apple", "Banana", "Orange"]
arr2 = [false, true, false]
The expected output is:
["Banana"]
I tried
arr1.filter(item => arr2[item])
but it didn't work. Could you please figure out where I was wrong and what could be a better solution. Your answers will be highly appreicated.

itemis andconsole.log(arr2[item])would immediately reveal why this doesn’t work. And the linked question can be found by literally typing your exact title into Google (second result).