mdn / sprints

Archived: MDN Web Docs issues are tracked in the content repository.
https://github.com/mdn/content
Creative Commons Zero v1.0 Universal
150 stars 142 forks source link

Code updation #3951

Closed shivamrathi99 closed 3 years ago

shivamrathi99 commented 3 years ago

URL(s)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex

Request type

Details

const array1 = [5, 12, 8, 130, 44]; const isLargeNumber = (element) => element > 13; console.log(array1.findIndex(isLargeNumber));

This code snippet can be shown like this:

const array1 = [5, 12, 8, 130, 44]; const isLargeNumber = array1.findIndex(element => element > 10); console.log(isLargeNumber);

it improves the readability

thanks