本文介绍了Javascript:如何将数组映射和将字符串内容拆分到新单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该在js上使用哪个代码来映射具有拆分单元格但不将["12,3","3","5","66,22"]插入["12","3","5","66","22"]的数组.

Which code should I use on js to map an array with spliting cells yet not reapeating ["12,3","3","5","66,22"] into ["12","3","5","66","22"].

推荐答案

您可以加入并拆分字符串.

You could join and split the string.

console.log(["12,3", "3", "5", "66,22"].join().split(','));

这篇关于Javascript:如何将数组映射和将字符串内容拆分到新单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 16:36