Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

usestate array delete

const removeProduct = (index) => {
  setProductsArray([
    ...products.slice(0, index),
    ...products.slice(index + 1, products.length)
  ]);
}
Source by www.techiediaries.com #
 
PREVIOUS NEXT
Tagged: #usestate #array #delete
ADD COMMENT
Topic
Name
3+4 =