replace for..in for loops for for..of + destructuring
This commit is contained in:
parent
89a4687c81
commit
6368a9882a
11
l3config.js
11
l3config.js
|
@ -25,8 +25,8 @@ function makeText(text) {
|
|||
function makeInput(id, attrs) {
|
||||
let ret = document.createElement('input');
|
||||
ret.setAttribute('id', id);
|
||||
for (const attr in attrs) {
|
||||
ret.setAttribute(attr, attrs[attr]);
|
||||
for (const [attr, value] of Object.entries(attrs)) {
|
||||
ret.setAttribute(attr, value);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -68,8 +68,7 @@ class L3Section {
|
|||
}
|
||||
|
||||
let optstrs = [];
|
||||
for (const opt in compiledopts) {
|
||||
const values = compiledopts[opt];
|
||||
for (const [opt, values] of Object.entries(compiledopts)) {
|
||||
if (values.length == 1) {
|
||||
optstrs.push(`option ${opt} '${values[0]}'`);
|
||||
} else {
|
||||
|
@ -208,8 +207,8 @@ class L3Select {
|
|||
|
||||
this.input = document.createElement('select');
|
||||
this.input.setAttribute('id', this.id);
|
||||
for (const attr in this.attrs) {
|
||||
this.input.setAttribute(attr, this.attrs[attr]);
|
||||
for (const [attr, value] of Object.entries(this.attrs)) {
|
||||
this.input.setAttribute(attr, value);
|
||||
}
|
||||
div.appendChild(this.input);
|
||||
|
||||
|
|
Loading…
Reference in New Issue