修改json对象的每一个值
Posted where there is a will, there i
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了修改json对象的每一个值相关的知识,希望对你有一定的参考价值。
function fun1(obj){ var names={}; /*for in 可以用于数组或者对象*/ for(var name in obj){ names[name] = obj[name].toLowerCase() } console.log(names); }; var obj1 = {username: \'NAME\', password: \'WOSHIDHS123\'}; fun1(obj1);
以上是关于修改json对象的每一个值的主要内容,如果未能解决你的问题,请参考以下文章
错误代码:错误域 = NSCocoaErrorDomain 代码 = 3840“JSON 文本没有以数组或对象和允许未设置片段的选项开头。”