arr.forEach((item, idx) => {
if (item == "") {
switch (idx) {
case 0:
console.log("")
break;
case 1:
console.log("")
break;
case 2:
console.log("")
break;
case 3:
console.log("")
break;
case 4:
console.log("")
break;
}
}
})
now the output is to print out all the empty items. What I want to get is that even if all five item inputs are empty, there is only one printed result
. Any one will do. Excuse me, how can it be realized?