Im trying to remove prev and next links from array. Using laravel vue3 inertiajs.
const splicedlinks = computed(() => {
let prevIndex = props.links.meta.links
.map((link) => link.label)
.indexOf("« Previous");
let nextIndex = props.links.meta.links
.map((link) => link.label)
.indexOf("Next »");
props.links.meta.links.splice(prevIndex, 1);
props.links.meta.links.splice(nextIndex, 1);
return props.links.meta.links;
});
With this code i managed only to remove "« Previous", but not "Next »"
Whats wrong with my code?
i explained what i tried in question.