Clean up code
This commit is contained in:
parent
10078cde5f
commit
1e5c66fb64
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue