If at least one of the values returned from the loop is true, the function must return true. How can I do this?
const addCart = () => {
for (let i = 0; i < props.cart.length; i++) {
return props.cart[i].domainName === props.domainName;
}
};