I'm searching in svelte documentation about this, but I can't get it.
What I want is to show only 4 objects from an array
For example:
let data = [
{id:1, name: 'John'},
{id:2, name: 'Peter'},
{id:3, name: 'Stev'},
{id:4, name: 'Clar'},
{id:5, name: 'Eyad'},
{id:6, name: 'Vector'}
]
Then the results only show
John
Peter
Stev
Clar
Seems like ReactJS as you just add index
in map()
function.