Articles → JAVASCRIPT → every function in JavaScript

every function in JavaScript






Purpose







Example


<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta charset="utf-8" />
      <title></title>
      <script>
         var arr = [18, 16, 21, 24];
         console.log("Array 1: " + arr.every(element => element > 15));
         
         arr = [18, 14, 21, 24];
         console.log("Array 2: " + arr.every(element => element > 15));
      </script>
   </head>
   <body></body>
</html>



Output


Picture showing the output of every function in JavaScript

Click to Enlarge


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

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250