Answers for "includes in js string"

59

javascript string contains

var string = "foo",
    substring = "oo";

console.log(string.includes(substring));
Posted by: Guest on December-21-2019
3

javascript string contains

var email = "[email protected]";
if(email.includes("@")){
  console.log("Email is valid");
}
else{
  console.log("Email is not valid");
}
// includes return boolean, if your string found => true else => false
Posted by: Guest on June-19-2021
7

.includes( string

var str = "Hello world, welcome to the universe.";
var n = str.includes("world");
Posted by: Guest on November-14-2019
3

string contains javascript

const s1 = 'javascript';
const s2 = 'python';

console.log(s1.includes('script')); // true
console.log(s2.includes('script')); // false
Posted by: Guest on February-05-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language