- accepted / - tried
When array is used in React state, we need to deal with actions such as push and remove.
push
remove
Implement useArray() to make life easier.
useArray()
const {value, push, removeByIndex} = useArray([1, 2, 3])
What is time & space complexity of your approach?
Try it out
Console