I have a problem when executing my code since the idea is that when a product is already registered only the amount and price can be entered, however, entering the same product key instead of leaving that allows me to change the name of the product (which should not happen since that product key can only have one name) because this is for the provider's key and yaesta2 = product key
if(menu==2){
yaesta=0;
yaesta2=0;
proveedor1=prompt("Ingrese ID del proveedor")
for(x=1;x<=renglon;x++){
if(proveedor1===clave[x])
{
yaesta=1;
}
}
if(yaesta===0){
alert("No se encontró ID")
}
if(yaesta===1) {
producto1=prompt("Ingrese clave del producto uwu")
for(x=1;x<100;x++)
{
if(producto1=producto[x])
{
yaesta2=1;
}
}
}
if(yaesta2===1 && yaesta===1){
alert("Producto encontrado: "+producto[x]);
producto[x]=prompt("Ingrese precio de "+producto[x]);
cantidad[x]=prompt("Ingrese cantidad de "+ producto[x]);
}
if(yaesta2===0 && yaesta===1){
producto[x]=prompt("Ingrese nombre del producto")
precio[x]=prompt("Ingrese precio del producto")
cantidad[x]=prompt("Ingrese cantidad de producto")
}
}//Adquisiciones