Answers for "java script how to check if string include in a string ?"

16

string check javascript

if (typeof myVar === 'string') { /* code */ };
Posted by: Guest on July-23-2020
5

.includes javascript

let storyWords = ['extremely literally actually hi bye okay']
let unnecessaryWords = ['extremely', 'literally', 'actually' ];

let betterWords = storyWords.filter(function(word) {
  return !unnecessaryWords.includes(word);
});
console.log(betterWords) // ['hi' 'bye' 'okay]
Posted by: Guest on June-14-2020

Code answers related to "java script how to check if string include in a string ?"

Code answers related to "Javascript"

Browse Popular Code Answers by Language