首页 > 技术文章 > IE11 - Object doesn't support property or method 'includes'

xiao-lei 2017-01-19 20:39 原文

IE不支持字符串的includes()方法;可以用indexOf()替换;

includes()方法返回true和false;

var str = "asdklmn";

if(str.includes()){

}可用if(str.indexOf("dkl")>=0){

........

}替换;

 

推荐阅读