Modernize ES for-loops and remove problematic for-in loops

This slightly modifies the behaviour of errors (see init.js)

Change-Id: I1aab691d5b7e8167b6213378bdd9139c133202cd
diff --git a/dev/js/src/panel/match.js b/dev/js/src/panel/match.js
index c901cee..a6c50db 100644
--- a/dev/js/src/panel/match.js
+++ b/dev/js/src/panel/match.js
@@ -87,9 +87,7 @@
         if (matchButtons) {
 
           // Add all matchbuttons in order
-          for (i in matchButtons) {
-            a.add.apply(a, matchButtons[i]);
-          }
+          matchButtons.forEach(m => a.add.apply(a, m));
         };
       };
 
@@ -142,13 +140,8 @@
       var spans = match.getSpans();
       var rels = match.getRels();
       
-      var i;
-      for (i in spans) {
-        treeLayers.push(spans[i]);
-      };
-      for (i in rels) {
-        treeLayers.push(rels[i]);
-      };
+      spans.forEach(i => treeLayers.push(i));
+      rels.forEach(i => treeLayers.push(i));
 
       // Get spans
       treeLayers = treeLayers.sort(