Created
July 10, 2018 00:00
-
-
Save whoisryosuke/be4f5872df07be98f45c86c4dc73220f 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 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
Thanks man. you just save my life... <3