Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

array.some()

<script>
  
// JavaScript code for some() function 
function isodd(element, index, array) {  
    return (element % 2 == 1);  
} 
    
function geeks() { 
    var arr = [ 6, 1, 8, 32, 35 ]; 
      
    // check for odd number 
    var value = arr.some(isodd); 
    console.log(value); 
} 
geeks(); 
</script>
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
1+9 =