js/scripts.js
/** 
 * Removes Product to list. Does not persist.
 * @param {string} key - Key of the item to remove
 */
Removes Product to list. Does not persist.
@param {string} key - Key of the item to remove
Removes Product to list . Does not persist . @param { string } key - Key of the item to remove
function deleteProduct(key) {
  const index = productList.findIndex(item => item.id === Number(key));
  const product = {
    deleted: true,
    ...productList[index]
  };
  productList = productList.filter(item => item.id !== Number(key));
  renderProduct(product);
}
function deleteProduct ( key ) { const index = productList . findIndex ( item => item . id === Number ( key ) ) ; const product = { deleted : true , ... productList [ index ] } ; productList = productList . filter ( item => item . id !== Number ( key ) ) ; renderProduct ( product ) ; }
Removes Product to list.
Removes Product to list .