数组转字符串
var a =[1,2,3]
b = a.join(",");
字符串转数组
vars = "abc,abcd,aaa";
ss = s.split(",");// 在每个逗号(,)处进行分解。
json字符串----->json对象
(1) var jsonStr = '{"name":"zhangsan","age":23,"email":"chentging@aliyun.com"}';var json =JSON.parse(jsonStr);
(2) var jsonStr = '{"name":"zhangsan","age":23,"email":"chentging@aliyun.com"}';var json = eval ("(" + jsonStr +")");
json对象------>json字符串
var json = {name:"zhangsan",age:23,email:"chentging@aliyun.com"};
var jsonStr = JSON.stringify(json);