I am not finding any solutions. Everywhere show just first and last element of an array.
Suppose, I have an array
[
{ name: "Hero", Id: "hero" },
{ name: "About", Id: "about" },
{ name: "Proccess", Id: "process" },
{ name: "Mission", Id: "mission" },
{ name: "Skill", Id: "skill" },
{ name: "Service", Id: "service" },
{ name: "Work", Id: "work" },
{ name: "Contact", Id: "contact" },
]
Here each object has a Id. Suppose active Id is service. When I active Id is service, then I have to find it previous and next Id (previous skill, next work). Here I have to find just previous and next Object according to active Id. Here Active Id can changed. When Active Id is changed then I have to find the changes previous and next object id.
I think I can clear the question. For mine it difficult. Please help me.