print odd numbers in an array in javascript

Solutions on MaxInterview for print odd numbers in an array in javascript by the best coders in the world

showing results for - "print odd numbers in an array in javascript"
Mikayla
24 Jul 2018
1[1,2,3,4].forEach((num) => num % 2 === 0 && console.log(num));
Freddy
03 Oct 2019
1public int[] findEvens() {
2  int numberEvens = 0;
3  for (int i = 0; i < numbers.length; i++) {
4     if (i % 2 == 0) {
5        numberEvens++;
6     }
7  }
8