數(shù)組轉(zhuǎn)字符串
var a =[1,2,3]
b = a.join(",");
字符串轉(zhuǎn)數(shù)組
vars = "abc,abcd,aaa";
ss = s.split(",");// 在每個(gè)逗號(hào)(,)處進(jìn)行分解忿晕。
json字符串----->json對(duì)象
(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對(duì)象------>json字符串
var json = {name:"zhangsan",age:23,email:"chentging@aliyun.com"};
var jsonStr = JSON.stringify(json);