js/catalog.js
// TODO: Add the selected item and quantity to the cart
Add the selected item and quantity to the cart
Add the selected item and quantity to the cart
function addSelectedItemToCart() {
  var selectedItem = selectElement.value;
  var quantity = document.getElementById('quantity').value;
  if (quantity < 1){
    alert(`Please enter a valid amount`);
  } else {
  var newCartItem = new CartItem(selectedItem, quantity);
  cart.items.push(newCartItem);
  }
}
function addSelectedItemToCart ( ) { var selectedItem = selectElement . value ; var quantity = document . getElementById ( 'quantity' ) . value ; if ( quantity < 1 ) { alert ( ` ` ) ; } else { var newCartItem = new CartItem ( selectedItem , quantity ) ; cart . items . push ( newCartItem ) ; } }
TODO: Add the selected item and quantity to the cart
TODO : Add the selected item and quantity to the cart
// TODO: suss out the item picked from the select list // TODO: get the quantity // TODO: using those, add one item to the Cart // console.log(cart);