Clean up code

This commit is contained in:
Ramon Wenger 2020-04-14 12:18:25 +02:00
parent 10078cde5f
commit 1e5c66fb64
1 changed files with 2 additions and 4 deletions

View File

@ -64,10 +64,8 @@
// this means the answer comes from a matrix, where the keys are the labels and the values are the respective answers // this means the answer comes from a matrix, where the keys are the labels and the values are the respective answers
let answerObject = answer.answer; let answerObject = answer.answer;
let keysAndValues = []; let keysAndValues = [];
for (let i in answerObject) { for (let prop of Object.keys(answerObject)) {
if (answerObject.hasOwnProperty(i)) { keysAndValues.push(`${prop}: ${answerObject[prop]}`);
keysAndValues.push(`${i}: ${answerObject[i]}`);
}
} }
answerText = keysAndValues.join(', '); answerText = keysAndValues.join(', ');
} else { } else {