Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Check if an array contains a string in javascript

const colors = ['red', 'green', 'blue'];
const result = colors.includes('red');

console.log(result); // true
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Check #array #string #javascript
ADD COMMENT
Topic
Name
3+9 =