index localstorage object

Solutions on MaxInterview for index localstorage object by the best coders in the world

showing results for - "index localstorage object"
Pietro
23 Oct 2017
1const data = [
2  {id: 'jijijoj',rating: 'g'}, 
3  {id: 'iojiojoi',rating: 'r'}, 
4  {id: 'eawfe',rating: 'pg'}, 
5  {id: 'ewfewfwe',rating: 'g'}, 
6  {id: 'ewfewfew',rating: 'r'}
7];
8
9// get index of element with id `iojiojoi`
10const index = data.findIndex(item => item.id === 'iojiojoi');
11
12console.log(index);