Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

filter array of even numbers

var arr1 = [-200, -163, -26, -4, 0, 7, 76];

var evens = arr1.filter(function(x) {
   return x % 2 === 0;
})

console.log(evens);
Comment

filter array odd number

const oddFiltration = (arr) => {
    const result = arr.filter(n => n%2);

    
      return (result);
}

//if you find this answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)
Comment

PREVIOUS NEXT
Code Example
Javascript :: react history.push 
Javascript :: tsconfig.json not generated 
Javascript :: javascript object remove empty properties 
Javascript :: jquery find checkbox by value 
Javascript :: us phone number regex 
Javascript :: how to get specific word from the string javascript 
Javascript :: jquery on focus 
Javascript :: example of pre increment in js 
Javascript :: deprecation warning: value provided is not in a recognized rfc2822 or iso format. moment construction falls back to js date(), which is not reliable across all browsers and versions 
Javascript :: javascript mysql datetime 
Javascript :: js test undefined 
Javascript :: jquery checkbox listener not working on programmatically change 
Javascript :: json file with multiple records 
Javascript :: vuejs bootsrap modal hidden event 
Javascript :: check if element is visible or hidden in dom 
Javascript :: toast angular 
Javascript :: how to use jquery timepicker 
Javascript :: opencv rtsp stream python 
Javascript :: javascript class access static property 
Javascript :: Removing Service Workers Programmatically 
Javascript :: conditionally changing styled components based on props 
Javascript :: emotion react 
Javascript :: javascript array to string 
Javascript :: isInt js 
Javascript :: jquery find div with data attribute value 
Javascript :: Change the HTML of an element 
Javascript :: discord.js get first mention 
Javascript :: Reverse numbers from an array in javascript 
Javascript :: js how to sort array by string length 
Javascript :: layout nextjs 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =