why javascript contains property is not working in chrome browser?

前端 未结 6 1311
孤城傲影
孤城傲影 2021-02-01 15:39

Why javascript contains property is not working in chrome browser? I have tried that Contains Property in javascript.It is working fine in Mozila Firefox Browser. But It is

6条回答
  •  难免孤独
    2021-02-01 16:01

    Use your own contains method and override firefox's contains() method. Because this method is widely used I mean -> (indexof).

    String.prototype.contains = function(str) { return this.indexOf(str) != -1; };
    

提交回复
热议问题