Home > Article > Web Front-end > How to solve the problem that JavaScript find method does not support IE
This article mainly brings you a brief discussion on the problem that the JavaScript find method does not support IE. The editor thinks it is quite good, so I will share it with you now and give it as a reference for everyone. Let’s follow the editor to take a look, I hope it can help everyone.
Recently, I encountered a JavaScript problem during front-end development.
<script type="text/javascript"> var arrayList = new Array(); arrayList.push(1); arrayList.push(2); arrayList.push(3); arrayList.push(4); arrayList.find(function (val) { if (val == 4) { console.log('This is a test'); } }); </script>
Using Chrome and Firefox, the running results are normal. However, the error "The object does not support the find attribute or method" did appear in IE.
After reading the official document, I found that it does not support IE.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find
javascript find method to find elements
ThinkPHP find method to query a data record
find in thinkphp mode Method invalid
The above is the detailed content of How to solve the problem that JavaScript find method does not support IE. For more information, please follow other related articles on the PHP Chinese website!