JsonToString

function JsonToString(o) {    
        var arr = []; 
        var fmt = function(s) { 
            if (typeof s == 'object' && s != null) return JsonToStr(s); 
            return /^(string|number)$/.test(typeof s) ? "'" + s + "'" : s; 
        } 
        for (var i in o) 
             arr.push("'" + i + "':" + fmt(o[i])); 
        return '{' + arr.join(',') + '}'; 
    } 
高否?富否?帅否? 否? 滚去学习!
原文地址:https://www.cnblogs.com/baixc/p/3681352.html