Beautiful! findIndex() is super powerful.
💛 JavaScript tip 💛 indexOf uses strict equality comparison under the hood. This means it can only ever find the exact reference but not an identical object. 'findIndex' fixes this because you can pass a callback you can use to identify an object. ↓
1
31
123
17
0
3
14
123
16
0
Another powerful use of findIndex(): const a = [2, 8, 73 /*,…*/]; const s = 55; if (1 + findIndex(x=>x==s)) { console.log("a contains s"); };
0
0
9
0
28
1st Dr.V.Chandrasekar BCA., MCA., Mphil/ Phd Computer Sciences ., Pursuing., Computer Subject:Java and Javascript Program . (100/100).Programmer., Software Engineer. Cell number:9360949895. E-mail:[email protected] 🙂 Freelaunzer 🇮🇳🥘🍲.
0
0
0
0
2
United States เทรนด์
- 1. #heatedrivalry 97.2K posts
- 2. Rams 79.6K posts
- 3. Rams 79.6K posts
- 4. ilya 86.5K posts
- 5. Sam Darnold 20.9K posts
- 6. Puka 53.2K posts
- 7. Andrea 28.7K posts
- 8. svetlana 8,299 posts
- 9. Stafford 22.4K posts
- 10. Al Michaels 2,933 posts
- 11. SCOTT HUNTER 13.5K posts
- 12. #PowerForce 1,602 posts
- 13. Ben Shapiro 49.3K posts
- 14. #zzzSpecialProgram 7,146 posts
- 15. Rose 171K posts
- 16. jacob tierney 6,526 posts
- 17. #TSTheEndOfAnEra 11.4K posts
- 18. #zzzero 36.2K posts
- 19. Connor Storrie 18.2K posts
- 20. McVay 8,409 posts
Loading...
Something went wrong.
Something went wrong.