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/match/meta.js b/dev/js/src/match/meta.js
index c4cd63f..78b1430 100644
--- a/dev/js/src/match/meta.js
+++ b/dev/js/src/match/meta.js
@@ -56,12 +56,9 @@
};
// TODO: Meta fields should be separated
- const keys = Object.keys(posInMetaArray);
-
// Sort all meta keys alphabetically
- for (let i in keys.sort()) {
- let k = keys[i]; // This is the title
- let field = fields[posInMetaArray[keys[i]]]; // This is the object
+ Object.keys(posInMetaArray).sort().forEach(function(k) {
+ let field = fields[posInMetaArray[k]]; // This is the object
// Ignore internal IDs
if (k !== "UID" &&
@@ -111,7 +108,7 @@
metaDL.appendChild(metaL);
};
- };
+ });
// Add corpusByMatch assistant
this._corpusByMatch = cbmClass.create(this._element);