• 코드:
​x
 
1
<!DOCTYPE html>
2
<html lang="ko">
3
​
4
<head>
5
    <meta charset="UTF-8">
6
    <title>JavaScript Array Object</title>
7
</head>
8
​
9
<body>
10
​
11
    <h1>some() 메소드</h1>
12
​
13
    <script>
14
        var arr = [10, 25, -20, 14];
15
        function compareValue(value) {
16
            return value < 10;  // 배열 요소 중 -20만이 10보다 작음.
17
        }
18
​
19
        document.write(arr.some(compareValue)); // true
20
    </script>
21
    
22
</body>
23
​
24
</html>