```javascript
"["1467770689074237440","1500815733465026560","1500988372619890688","1465925810929012736"]“
怎么吧上面的字符串转化成下面的数组
[ 1467770689074237440,1500815733465026560,1500988372619890688, 46592581092901273
```6 ]
收起
使用eval()
const arr = '["1467770689074237440","1500815733465026560","1500988372619890688","1465925810929012736"]' console.log(eval(arr))
使用JSON.parse()
const arr = '["1467770689074237440","1500815733465026560","1500988372619890688","1465925810929012736"]' console.log(JSON.parse(arr))
都可以
报告相同问题?
程序员都在用的中文IT技术交流社区
专业的中文 IT 技术社区,与千万技术人共成长
关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!