QP School
QP School
>
Tutorials
>
JavaScript Tutorials
> Check if an array contains a number in JavaScript
Full Version:
Check if an array contains a number in JavaScript
You're currently viewing a stripped down version of our content.
View the full version
with proper formatting.
Qomplainerz
04-04-2023, 07:12 AM
// Check if an array contains a number
const ratings = [1, 2, 3, 4, 5];
let result = ratings.includes(4);
document.write(result);
QP School
>
Tutorials
>
JavaScript Tutorials
> Check if an array contains a number in JavaScript