Compare two Arrays and replace Duplicates with values from a third array

前端 未结 7 1907
不思量自难忘°
不思量自难忘° 2021-01-22 11:54
var array1 = [\'a\',\'b\',\'c\',\'d\'];
var array2 = [\'a\',\'v\',\'n\',\'d\',\'i\',\'f\'];

var array3 = [\'1\',\'2\',\'3\',\'4\',\'5\',\'6\'];

Just s

7条回答
  •  抹茶落季
    2021-01-22 12:36

    there are many forms, this is a basic form:

    var array1 = ['a','b','c','d'];
    var array2 = ['a','v','n','d','i','f'];
    var array3 = ['1','2','3','4','5','6'];
    var result = [];//define array of result
    for(var i=0;i

提交回复
热议问题