diff --git a/UI/renderer.js b/UI/renderer.js index d91c4b5..0e45906 100644 --- a/UI/renderer.js +++ b/UI/renderer.js @@ -25,7 +25,7 @@ function refreshSerialPorts() select = document.getElementById('portsSelect'); //Clear the current options - for (i = 0; i <= select.options.length; i++) + while (select.options.length > 0) { select.remove(0); //Always 0 index (As each time an item is removed, everything shuffles up 1 place) } @@ -268,7 +268,7 @@ function requestPatternList() //Clear the existing list var select = document.getElementById('patternSelect') - for (i = 0; i <= select.options.length; i++) + while(select.options.length > 0) { select.remove(0); //Always 0 index (As each time an item is removed, everything shuffles up 1 place) }