富国沪深
拆分成单独的项目,过滤并加入:const list1 = '6,2', list2 = '1,2,4,5,6,7,9,12,13', result = list2 .split(',') .filter(n => !list1 .split(',') .includes(n)) .join(',') console.log(result)