JS: 將對象在轉化成string在控制檯中打印出現

直接使用以下方法,在使用時,直接consloe.log(objectString(object))javascript function objectString(o){ var r=[]; if(typeof o=="string"){ return "\""+o.replace(/([\'\"\\])/g,"\\$1").replace(/(\n)/g,"\\n").replac
相關文章
相關標籤/搜索