Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Find Whether an Array Includes a Certain Value</title> </head> <body> <script> var arr = [1, 0, 3, 1, false, 5, 1, 4, 7]; document.write(arr.includes(1) + "<br>"); // Prints: true document.write(arr.includes(6) + "<br>"); // Prints: false document.write(arr.includes(1, 2) + "<br>"); // Prints: true document.write(arr.includes(3, 4)); // Prints: false </script> </body> </html>