Modernize for;;-loops
Change-Id: Ic6f86af0d674cc6643fc9eef2aa7431cfdf514f2
diff --git a/dev/js/src/match/meta.js b/dev/js/src/match/meta.js
index 78b1430..3cc7512 100644
--- a/dev/js/src/match/meta.js
+++ b/dev/js/src/match/meta.js
@@ -50,10 +50,8 @@
// Copy original array position to object
// before sorting by key title
let posInMetaArray = {};
- for (let i = 0; i < fields.length; i++) {
- posInMetaArray[fields[i]["key"]] = i;
+ fields.forEach((f,i) => posInMetaArray[f["key"]] = i);
- };
// TODO: Meta fields should be separated
// Sort all meta keys alphabetically
@@ -82,18 +80,17 @@
metaDD.setAttribute('data-type', field["type"]);
if(metaDescr instanceof Array){
- metaDD.classList.add("metakeyvalues");
- for (i = 0; i < metaDescr.length; i++){
-
+ metaDD.classList.add("metakeyvalues");
+ metaDescr.forEach(function(md) {
if (field["type"] === 'type:attachement') {
- let att = attClass.create(metaDescr[i]);
+ let att = attClass.create(md);
if (att)
metaDD.addE('div').appendChild(att.inline());
}
else {
- metaDD.addE('div').addT(metaDescr[i]);
+ metaDD.addE('div').addT(md);
}
- }
+ });
}
else{
if (field["type"] === 'type:attachement') {