Search
 
SCRIPT & CODE EXAMPLE
 

CSS

javavscript use .filter to return odd numbers in an array

let arr = [1,2,3,4,5,6,7,8,9,10,11,12]

let odds = arr.filter(n => n%2)

console.log(odds)
Comment

array filter odd value

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
Css :: delete after content css 
Css :: style highlight css 
Css :: background image overlay 
Css :: how to set image size without changing aspect ratio in css 
Css :: how to margin placeholdr text 
Css :: css especifico para safari 
Css :: background color css 
Css :: how to x axis scroll css 
Css :: smooth scroll 
Css :: css supports 
Css :: how to make hr class bootstrap full width 
Css :: how to call media query inside css class 
Css :: color code green 
Css :: scss percentage 
Css :: Resetting Default Table Styles 
Css :: css circle with number 
Css :: font-face html 
Css :: css grid row height with repeat 
Css :: display content in column css 
Css :: import custom font 
Css :: nodelist map 
Css :: padding in one line 
Css :: bootstrap progress bar animation not working 
Css :: tailwind center absolute 
Css :: css remove second element 
Css :: background image opacity css 
Css :: select two stuffes css 
Css :: onclick after color change in css 
Css :: box shadow to table cell css 
Css :: Trimming One Line with CSS 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =