javascript打印对象函数

//js对象打印函数
function writeObj(obj) {
    var description = "";
    for (var i in obj) {
        var property = obj[i];
        description += i + " = " + property + "\n";
    }
    alert(description);
}

 

posted @ 2017-12-27 17:17  雨落知音  阅读(4358)  评论(0编辑  收藏  举报