concat without dublicate item
var a = [1, 2, 3], b = [101, 2, 1, 10]
var c = a.concat(b.filter((item) => a.indexOf(item) < 0))
concat without dublicate item
var a = [1, 2, 3], b = [101, 2, 1, 10]
var c = a.concat(b.filter((item) => a.indexOf(item) < 0))
concat ignore duplicates
ResultArray = record.concat(ResultArray.filter((item) => a.indexOf(item) < 0));
//ResultArray (Array)
[
{ location_name: 'Fresno', location_id: 1001 },
{ location_name: 'New York', location_id: 1002 },
{ location_name: 'Fresno', location_id: 1001 },
{ location_name: 'New York', location_id: 1002 }
]
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us