const indiceDeProducto = (carrito, idProducto) => { | |
return carrito.findIndex(productoDentroDelCarrito => productoDentroDelCarrito.id === idProducto); | |
} | |
const existeProducto = (carrito, producto) => { | |
return indiceDeProducto(carrito, producto.id) !== -1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment