QP School
QP School
>
Tutorials
>
JavaScript Tutorials
> Check if an array contains a string in JavaScript
Full Version:
Check if an array contains a string 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:14 AM
// Check if an array contains a string
const colors = ['red', 'green', 'blue'];
const result = colors.includes('red');
document.write(result);
QP School
>
Tutorials
>
JavaScript Tutorials
> Check if an array contains a string in JavaScript