-1
I’m creating a chatbot in wtsapp to return the elements of an array...only I need a line break... I’ve tried n nothing. it returns in different messages.. would like to have q line break in the same message.
I want these two items to go out in the same message and not separately as above.
follows the code:
for (let i = 0; i < itemkeys.length; i++) {
let item = peditems[itemkeys[i]];
if (item.box_type1 == 'Risoto de Galinhada') {
precounit = 20;
} else if (item.box_type1 == 'Carreteiro') {
precounit = 20;
} else if (item.box_type1 == 'Caipira') {
precounit = 18;
} else if (item.box_type1 == 'Baião de Dois') {
precounit = 17;
} else if (item.box_type1 == 'Risoto de Filé Mignon') {
precounit = 25;
} else if (item.box_type1 == 'Risoto de Frango e Bacon') {
precounit = 20;
} else if (item.box_type1 == 'Risoto de Camarão') {
precounit = 30;
} else if (item.box_type1 == 'Risoto de Galinhada') {
precounit = 20;
} else if (item.box_type1 == 'Shitake e Gorgonzola') {
precounit = 28;
} else if (item.box_type1 == 'Shitake Vegano') {
precounit = 25;
}
subtotal = precounit*item.number;
agent.add(` ${item.number} ${item.box_type1}` + ' - R$ ' + subtotal.toFixed(2));
contador = contador + 1;
var subtotarray = [];
var adiciona = subtotarray.push(subtotal);
for(var t = 0; t < subtotarray.length; t++){
total = total + subtotarray[t];
}