📜  使用 for 循环 js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:57.006000             🧑  作者: Mango

代码示例4
var scores = [21, 35, 54, 46];
        var arrayLength = scores.length;
        var msg = '';
        var i;

        for (i = 0; i < arrayLength; i++) {
            roundNumber = (i + 1);
            msg += 'Round ' + roundNumber + ': ';
            msg += scores[i] + '
'; }