字符串(string)方法的扩展
1.includes() 返回的是布尔值 判断是否存在该字符
let str = "hello";
console.log(str.includes("h"));//true
console.log(str.includes("y"));//true
2 .startsWith() 返回布尔值判断字符是否出现在原字符串的头部
let str1 = "hello";
console.log(str1.startsWith("h")); //true
console.log(str1.startsWith("y")); //false
3 .endsWith() 返回布尔值 判断字符是否出现在原字符串的末尾
let str2 = "hello";
console.log(str2.endsWith("h")<