how to use array in if condition in javascript return value code example Example: find all of array which satisfy condition javascript myArray.filter(x => x > 5)