Articles → JAVASCRIPT → Array Some Function In Javascript

Array Some Function In Javascript






Purpose





Example




    <!DOCTYPE html>
    <html lang="en">
        <head>
            <script>
         var arr = [12, 13, 14, 15, 21];
         
         console.log("The value greater than 18 exists in the array:" + arr.some(CheckValue));
         
         function CheckValue(val) {
         
             return val > 18;
         }
         
      </script>
        </head>
        <body></body></html>



Output


Picture showing the output of the Array some function in JavaScript



Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, September 8, 2021

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250