var temp = [1,2,3,4,5]; console.log('type:',typeof temp); //输出:type: object console.log('length:',temp.length);//输出:length: 5 console.log('temp[0]:',temp[0]);//输出:temp[0]: 1 temp = JSON.stringify(temp); console.log('type:',typeof temp);//输出:type: string console.log('length:',temp.length);//输出:length: 11 console.log('temp[0]:',temp[0]);//输出:temp[0]: [ temp = JSON.parse(temp); console.log('type:',typeof temp);//输出:type: object console.log('length:',temp.length);//输出:length: 5 console.log('temp[0]:',temp[0]);//输出:temp[0]: 1