Skip to content

Instantly share code, notes, and snippets.

@just-boris
Created August 10, 2021 21:52
slice a list
function sliceItems(items, limit) {
if (items.length <= limit + 1) {
return { visible: items, hidden: [] };
}
return {
visible: items.slice(0, limit),
hidden: items.slice(limit)
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment