Answers for "print odd numbers in an array in javascript"

1

print odd numbers in an array in javascript

[1,2,3,4].forEach((num) => num % 2 === 0 && console.log(num));
Posted by: Guest on July-11-2021
0

get odd number in array

public int[] findEvens() {
  int numberEvens = 0;
  for (int i = 0; i < numbers.length; i++) {
     if (i % 2 == 0) {
        numberEvens++;
     }
  }
Posted by: Guest on May-29-2021

Code answers related to "print odd numbers in an array in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language