I really appreciate all your help on this.
I have two arrays:
- the first array contains file names without an extension
- the second array contains file names that have an extension.
I need to output a third array, in this case FinalArray
that contains a list of all the ArrayFileNameWExt
that are not in the ArrayFileName
array.
I know I had a thread on finding matched items, which was great. But I'm having problems finding the unmatched items. I changed the == comparison to !== and that gave me one file name a hundred times.
Thank you for your help on this, Maxine
var ArrayFileName = ['one', 'two', 'three', 'three', 'five', 'six', 'ten'];
var ArrayFileNameWExt = ['one.txt', 'two.txt', 'three.txt', 'ten.wmf', 'eleven.cgm'];
var FinalArray = [];
for (var i = 0; i < ArrayFileName.length; i++) {
for (var j = 0; j < ArrayFileNameWExt.length; j++) {
var temp = ArrayFileNameWExt[j].split(".");
if(ArrayFileName[i]!==temp[0]){
FinalArray.push(ArrayFileNameWExt[j]);
break;
}
}
}