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/vc/menu.js b/dev/js/src/vc/menu.js
index 0f0d92a..f2f4b2f 100644
--- a/dev/js/src/vc/menu.js
+++ b/dev/js/src/vc/menu.js
@@ -44,11 +44,9 @@
      * VCs and small key lists.
      */
     typeOf : function (key) {
-      for (i in this._items) {
-        if (this._items[i].key() === key) {
-          return this._items[i].type();
-        }
-      };
+      const found = this._items.find(i => i.key() === key);
+      if (found)
+        return found.type();
     }
   };
 });