IE9 array does not support indexOf

后端 未结 3 891
青春惊慌失措
青春惊慌失措 2021-01-11 23:57

Based on http://ie.microsoft.com/testdrive/HTML5/ECMAScript5Array/Default.html, I thought IE9 supports indexOf in array but the following breaks. Any idea why?



        
3条回答
  •  伪装坚强ぢ
    2021-01-12 00:22

    Are you sure your page is running in IE9 mode? Check in dev tools (F12). If you have old DOCTYPE you might be seeing your page in IE8/7 mode, so indexOf is not supported. If you are running in IE9 mode then it works just fine.

提交回复
热议问题