I need your help: In Javascript I create an array with push.
for (const elem of prod[i].motor) {
if (usedMotor.includes(elem) === false) {
motor.push('<li>'+elem+'</li>');
usedMotor.push(elem);
}
}
But if I want to display it with document.getElementById('spanMotorType').innerHTML = 'Applicable Motors:'+ motor;
it is printed with comma between the elements.
Applicable Motors:
Induction motor
,
Permanent magnet motor
,
Synchronous reluctance motor
Console shows this:
Array(3) [ "<li>Induction motor</li>", "<li>Permanent magnet motor</li>",
"<li>Synchronous reluctance motor</li>" ]
0: "<li>Induction motor</li>"
1: "<li>Permanent magnet motor</li>"
2: "<li>Synchronous reluctance motor</li>"
Is there a way how I can remove this comma? The length of the Array can be between 1 and 3.
thanks