Hello Friends 👋,
Welcome To Infinitbility! ❤️
includes() also use for the search string in the array you have to only pass user search text as a value in the
['red', 'green'].includes('red') //true ✅ ['red', 'green'].includes('yellow') //false ❌
includes() method also works on a string, for example, you have description text and you want to search word on paragraph text then it also works.
"Search String Match or not".includes('or'); // <.true
Thanks for Reading…