let a = ['ab', 'abc', 'abcd', 'def', 'defg']
let b = ['abc', 'abcd', 'defg'];
let result = a.concat(b);
//console.log(result);
let uniqueArray = result.filter((item, index) => result.indexOf(item) === index);
uniqueArray.sort();
console.log(uniqueArray);
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/76a7242e-9361-480f-976c-b1203438fdc3n%40googlegroups.com.
Hi, im new for apps script, i would like to ask how to get the unique value by comparing 2 arrays, for example array1 is [ab,abc,abcd,def,defg], array2 is [abc,abcd,defg], i want to compare this 2 arrays and then get the value that doesnt exist in both array('ab' and 'def').Appreciate for help.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/46a250a8-da3c-4a93-a572-641005427c6dn%40googlegroups.com.