Articles → JAVASCRIPT → Array Some Function In Javascript
Array Some Function In Javascript
Purpose
Example
<!DOCTYPE html>
<html lang="en">
<head>
<script>
var arr = [12, 13, 14, 15, 21];
console.log("The value greater than 18 exists in the array:" + arr.some(CheckValue));
function CheckValue(val) {
return val > 18;
}
</script>
</head>
<body></body></html>
Output