Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次元数が不明な連想配列を検索し、すべての null 値を空の文字列に変更する方法はありますか?
ありがとう!
多分このような何か:
var objectNullToEmpty = function (obj) { for (key in obj) { if (obj[key] === null) { obj[key] = ''; } if (typeof obj[key] === 'object') { objectNullToEmpty(obj[key]); } } return obj; };