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/selectMenu.js b/dev/js/src/selectMenu.js
index 9f447ca..4db1dcd 100644
--- a/dev/js/src/selectMenu.js
+++ b/dev/js/src/selectMenu.js
@@ -50,9 +50,7 @@
obj._container.addEventListener('click', obj.showSelected.bind(obj));
// Add index information to each item
- for (i in obj._items) {
- obj._items[i]._index = i;
- };
+ obj._items.forEach((e,i) => e._index = i);
// This is only domspecific
obj.element().addEventListener('blur', function (e) {
@@ -89,8 +87,7 @@
*/
selectValue : function (vParam) {
var qlf = this._select.options;
- var i;
- for (i in qlf) {
+ for (let i = 0; i < qlf.length; i++) {
if (qlf[i].value == vParam) {
this.hide();
this.select(i);