Check out example codes for "java filter array by even numbers". It will help you in understanding the concepts better.

Code Example 1

function even(t) {
    return t.filter(function(x){ return x % 2 == 0; });
}

Learn ReactJs, React Native from akashmittal.com