【发布时间】:2020-08-23 07:46:20
【问题描述】:
我有这个字符串:
var d = [
'[(not set),20200409,103,0.0]',
'[(not set),20200410,112,0.0]',
'[(not set),20200411,56,0.0]',
'[(not set),20200412,58,0.0]',
'[(not set),20200413,108,0.0]',
'[(not set),20200414,91,0.0]'];
但是我想要这种类型的数组通过转换字符串d 处理后的样子。
var processd_array = [
['(not set)',20200409,103,0.0],
['(not set)',20200410,112,0.0],
['(not set)',20200411,56,0.0],
['(not set)',20200412,58,0.0],
['(not set)',20200413,108,0.0],
['(not set)',20200414,91,0.0] ];
如何在 Nodejs 中做到这一点?
【问题讨论】:
-
你应该展示你已经尝试过的东西。见stackoverflow.com/help/how-to-ask。
-
您的字符串语法错误,并且在处理数组语法后也是错误的。您在错误的地方使用了反引号!
标签: javascript arrays node.js string