-
-
Save Uvacoder/0841f26547376a453ba55040c0e40672 to your computer and use it in GitHub Desktop.
Javascript - Limit a `.map()` loop to a certain number using `.slice()`- via: https://stackoverflow.com/questions/42374873/limit-items-in-a-map-loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var film = this.props.data.slice(0, 5).map((item) => { | |
| return <FilmItem key={item.id} film={item} /> | |
| }); | |
| return film; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment