How do you splice from both ends of an array either simultaneously or sequentially such that "leftsplice" number of fields are spliced from left and "rightsplice" number of fields are spliced from original array not the one after doing leftsplicing. Any tips?
const [skillname,setSkillName] = useState(["Engineering", "Product", "Organization", "Business", "Market", "Customer"]);
setSkillName(skillname => skillname.splice(0,leftsplice))
let temp=-5+leftsplice;
setSkillName(skillname => skillname.splice(temp, rightsplice))
This is doing only leftsplicing. PS: leftsplice, rightsplice are working as desired. I console.logged them