Check out example codes for "loop array using stream java". It will help you in understanding the concepts better.

Code Example 1

int[] ns = new int[] {1,2,3,4,5};
int[] ms = Arrays.stream(ns).map(n -> n * 2).filter(n -> n % 4 == 0).toArray();

Learn ReactJs, React Native from akashmittal.com