Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

find even numbers in an array javascript

arr.filter(num => num % 2)
Comment

how to find odd and even in a array

 public static void main(String[] args) {
        int[] xr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
        for (int i = 0; i < xr.length; i++) {
            System.out.println(xr[i] % 2 == 0 ? xr[i] + " -> even" : xr[i] + " -> odd");
        }
    }
Comment

Even numbers in an array

const evenNumbers = (array, number) => array.filter(item => item % 2 === 0).slice(-number);
Comment

PREVIOUS NEXT
Code Example
Javascript :: automated email sending using node js server 
Javascript :: javascript javascript javascript javascript javascript 
Javascript :: millis javascript 
Javascript :: find element and find elements 
Javascript :: how to create module in react 
Javascript :: display array javascript 
Javascript :: dynamodb async await 
Javascript :: node js package nodemon error 
Javascript :: javascript map callback function 
Javascript :: JS copy image 
Javascript :: activate router angular 
Javascript :: angular multiple validator pattern single input 
Javascript :: formidable form node js 
Javascript :: display form input on console jquery 
Javascript :: onClick button react send to another component 
Python :: abc list 
Python :: matplotlib change thickness of line 
Python :: python get username 
Python :: display maximum columns pandas 
Python :: how many nan in array python 
Python :: get gpu device name tensorflow 
Python :: delete pycache files 
Python :: dataframe column to string 
Python :: WARNING: There was an error checking the latest version of pip. 
Python :: copy to clipboard python 
Python :: python iterate directory 
Python :: EnvironmentError command line 
Python :: pandas rename specific column 
Python :: simple imputer python 
Python :: find text between two strings regex python 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =