Find Index

Find the index of the first element matching a condition.

Code

General
arr.findIndex(item => item.id === targetId);

Parameters

Array

ID to find

Browser·fetch() may be limited by CORS

More JavaScript Snippets