Articles → JAVASCRIPT → Findindex Function Of An Array In Javascript
Findindex Function Of An Array In Javascript
Purpose
Example
<!DOCTYPE html>
<html lang="en"
xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<script>
var arr = [14, 16, 21, 24];
console.log(arr.findIndex(element => element > 15));
</script>
</head>
<body></body></html>
Output