Home > Web Front-end > JS Tutorial > Regarding the problem that the find method in Js does not support IE

Regarding the problem that the find method in Js does not support IE

一个新手
Release: 2018-05-23 15:42:21
Original
2434 people have browsed it

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(&#39;This is a test&#39;);
            }
        });
    </script>
Copy after login

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

The above is the detailed content of Regarding the problem that the find method in Js does not support IE. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template