SOURCE

function ranking() {
    return {
        "giftName": "",
        "userName": ""
    }
}
function dasjfa() {
    for (var i = 0; i < 5; i++) {
        var _ranking = ranking()
        if (i == 0) {
            _ranking.giftName = "啤酒"
            _ranking.userName = "乐乐"
            console.log(_ranking)
        } else {
            _ranking.userName = undefined
            console.log(_ranking)
        }


    }
}
dasjfa()
console 命令行工具 X clear

                    
>
console