I am going to create an array called idArray which contains Id of students in a csv file. inputData is an array containing 10 objects(records of csv). Each object is an array and have a "Unique Id". I would like to check if I already have this "Unique Id" in my idArray, if no, add it to the array and if yes go to the next record.
getIds: function (inputData) {
inputData.forEach(function () {
if(idArray.length!=0) {
idArray.forEach(function () {
if (inputData."Unique Id"!= idArray)
idArray.push(inputData."Unique Id");
});
}
else
idArray.push(inputData."Unique Id");
});
return idArray;
}
I know that inputData."Unique Id" is wrong, but how can I get Unique Id?
Thanks