Published on January 26, 2024By DeveloperBreeze

// Array to check
let array = [1, 2, 3, 4, 5];

// Element to check for in the array
let element = 3;

// Check if the array contains the specified element
let containsElement = array.includes(element);

// Display the result
console.log('Array Contains Element:', containsElement);

Comments

Please log in to leave a comment.

Continue Reading:

Reversing a String in JavaScript: A Simple Guide

Published on January 26, 2024

javascriptpython

JavaScript Display To-Do List

Published on January 26, 2024

javascript

JavaScript Remove Duplicates from an Array

Published on January 26, 2024

javascript

JavaScript Sum of Array Elements

Published on January 26, 2024

javascript

Sorting an Array

Published on January 26, 2024

javascript

Image Slider

Published on January 26, 2024

javascript

Sorting an Array in JavaScript

Published on January 26, 2024

javascript