当前位置:网站首页>js如何将带有分割符的字符串转化成一个n维数组
js如何将带有分割符的字符串转化成一个n维数组
2022-07-01 17:49:00 【马克社区】
var str = “A-2-12”; var str1 = str.split(’-’); console.log(str1); var arr = str1.reverse().reduce((pre,cur,i) => { if(i==0) { pre.push(cur) return pre } return [cur,pre] },[]) console.log(arr) // [“A”[“B”,[“C”]]]
更多内容请见原文,原文转载自:http://www.mark-to-win.com/tutorial/50904.html
边栏推荐
- Key points on February 15, 2022
- About selenium element positioning being overwritten
- Intel's open source deep learning tool library openvino will increase cooperation with local software and hardware parties and continue to open
- ACM mm 2022 video understanding challenge video classification track champion autox team technology sharing
- Research Report on development prediction and investment direction of nylon filament sewing thread in China (2022 Edition)
- The reviewboard has 500 errors when submitting a review. Solutions
- Research Report on China's enzyme Market Forecast and investment strategy (2022 Edition)
- How to use JMeter function and mockjs function in metersphere interface test
- 網上股票開戶安全嗎?是否可靠?
- 麦趣尔:媒体报道所涉两批次产品已下架封存,受理消费者诉求
猜你喜欢

Product service, operation characteristics

An example of data analysis of an old swatch and an old hard disk disassembly and assembly combined with the sensor of an electromagnetic press

(28) Shape matching based on contour features

New patent applications and transfers
![Htt [ripro network disk link detection plug-in] currently supports four common network disks](/img/e4/c06b94243cdbe391b8b2124ff30789.jpg)
Htt [ripro network disk link detection plug-in] currently supports four common network disks

New 95 community system whole station source code

Intelligent operation and maintenance practice: banking business process and single transaction tracking

Detailed explanation of string's trim() and substring()
![[PHP foundation] realize the connection between PHP and SQL database](/img/eb/c8953eddfe3b19b0adb5529957d275.jpg)
[PHP foundation] realize the connection between PHP and SQL database

Cookies and session keeping technology
随机推荐
Research Report on China's enzyme Market Forecast and investment strategy (2022 Edition)
中国超高分子量聚乙烯产业调研与投资前景报告(2022版)
To improve the efficiency of office collaboration, trackup may be the best choice
Official announcement! Hong Kong University of science and Technology (Guangzhou) approved!
An example of data analysis of an old swatch and an old hard disk disassembly and assembly combined with the sensor of an electromagnetic press
Intel's open source deep learning tool library openvino will increase cooperation with local software and hardware parties and continue to open
Petrv2: a unified framework for 3D perception of multi camera images
Penetration practice vulnhub range Tornado
中国氮化硅陶瓷基板行业研究与投资前景报告(2022版)
[2. Basics of Delphi grammar] 4 Object Pascal operators and expressions
中国茂金属聚乙烯(mPE)行业研究报告(2022版)
vulnhub靶场-hacksudo - Thor
Radhat builds intranet Yum source server
(1) CNN network structure
How to use JMeter function and mockjs function in metersphere interface test
Countdownlatch blocking wait for multithreading concurrency
Penetration practice vulnhub range Keyring
中国一次性卫生用品生产设备行业深度调研报告(2022版)
Object. fromEntries()
Reflective XSS vulnerability