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
let answerObject = answer.answer;
let keysAndValues = [];
for (let i in answerObject) {
if (answerObject.hasOwnProperty(i)) {
keysAndValues.push(`${i}: ${answerObject[i]}`);
}
for (let prop of Object.keys(answerObject)) {
keysAndValues.push(`${prop}: ${answerObject[prop]}`);
}
answerText = keysAndValues.join(', ');
} else {