How to further split string in object for javascript please?

后端 未结 1 792
我在风中等你
我在风中等你 2021-01-29 01:21

I have two object now

obj1-> [ \'logo\', \'FinTech startup\', \'design\' ]
obj2-> [ \'logo\', \'tech startup\', \'design\' ]

What is the

相关标签:
1条回答
  • 2021-01-29 02:03

    You could use Array#join and Array#split with space.

    var array1 = ['logo', 'FinTech startup', 'design'],
        array2 = ['logo', 'tech startup', 'design'];
        
    array1 = array1.join(' ').split(' ');
    array2 = array2.join(' ').split(' ');
    
    console.log(array1);
    console.log(array2);
    .as-console-wrapper { max-height: 100% !important; top: 0; }

    0 讨论(0)
提交回复
热议问题