0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【js】連想配列では.lengthを使えない

Posted at

var scores = {Taro: 72, Ken: 93, Tom: 85, John: 68};

// この下にコードを書いてください
var sum = 0;
var cnt = 0;

for(var k in scores){
console.log(k+'さんは'+scores[k]+'点です');
sum += scores[k];
cnt++;
}
var ave = sum/cnt;
console.log('平均点は'+ave+'点です。');

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?