I have two arrays A = [1,5,9,12,14] and B = [16,4,8,12] both the arrays have the different length. I want to compare the array A with B. If the value of array A is available in B then don't do anything else add it to sheet. Below is my code for same but I am not getting desired output. can anybody help me on the same?
function updateTicketsAreNotInDeploymentDoc() {
var A = getJiraNoFromJira();
var B = getJiraNoFromDoc();
for(var i = 0; i<A.length; i++) {
var data = new Array();
for(var j=0; j<B.length; j++) {
if(A[i] == B[j]) {
Logger.log("found="+A[i]);
}
}
data.push(A[i]);
}
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheet = spreadsheet.getSheetByName(RESULTANT_DEPLOYMENT_SHEET);
sheet.appendRow(data);
}