/**对象中的字段null值替换为''*/
function replaceNull(someObj, replaceValue = "***") {
const replacer = (key, value) =>
String(value) === "null" || String(value) === "undefined" ? replaceValue : value;
return JSON.parse(JSON.stringify(someObj, replacer));
}
js 对象中的字段null值替换为‘‘
最新推荐文章于 2024-08-03 17:05:14 发布