回答編集履歴
1
再調整
answer
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
<script>
|
4
4
|
'use strict'
|
5
5
|
window.addEventListener('DOMContentLoaded',()=>{
|
6
|
+
const Average=score=>score.reduce((x,y)=>parseInt(x)+parseInt(y))/score.length;
|
6
7
|
const score=["65", "70", "85", "90", "50", "62", "76", "88", "64", "45"];
|
7
8
|
const fLength=score.length;
|
8
9
|
const display=document.querySelector("#display");
|
@@ -14,9 +15,6 @@
|
|
14
15
|
return li;
|
15
16
|
}));
|
16
17
|
display.appendChild(ul);
|
17
|
-
function Average(score){
|
18
|
-
return score.reduce((x,y)=>parseInt(x)+parseInt(y))/score.length;
|
19
|
-
}
|
20
18
|
console.log("The average score is:" + Average(score));
|
21
19
|
});
|
22
20
|
</script>
|