JavaScript includes() 判断是否包含指定字符串,含有为返回true,不含返回false

if(str.includes("指定字符串")){
  //do
}