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
15
122
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 Tendenze
- 1. #เพียงเธอตอนจบ 472K posts
- 2. LINGORM ONLY YOU FINAL EP 470K posts
- 3. #FanCashDropPromotion N/A
- 4. Good Friday 53.6K posts
- 5. #FridayVibes 5,525 posts
- 6. Ayla 68K posts
- 7. Tawan 97.3K posts
- 8. Cuomo 112K posts
- 9. No Kings 211K posts
- 10. #FursuitFriday 12.6K posts
- 11. Mamdani 266K posts
- 12. Justice 344K posts
- 13. Shabbat Shalom 2,633 posts
- 14. Happy Friyay 1,156 posts
- 15. #FridayFeeling 2,338 posts
- 16. RED Friday 2,822 posts
- 17. Bob Myers N/A
- 18. Flacco 104K posts
- 19. New Yorkers 47.2K posts
- 20. Dorado 4,318 posts
Loading...
Something went wrong.
Something went wrong.