Articles → JavaScript → Includes method in JavaScript

Includes method in JavaScript






Purpose





Example


<html>
<head>
    <title>Includes method demo</title>
    <script>
        var students = ["karan", "varun", "vijay"];
        alert(students.includes("karan"));
    </script>
</head>
<body></body>
</html>



Output


Picture showing the output of includes method in JavaScript

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Saturday, June 06, 2020

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250