nodejs字符串变数组

let numbers="[1,2,3]";
console.log(typeof(numbers));//输出string

let numbersarr= eval(numbers);
console.log(typeof(numbersarr));//输出object

 

posted @ 2018-07-20 13:36  沫沫w  阅读(4783)  评论(0编辑  收藏  举报