String List Comparison App

by black strings

HTML

<div id="container">

</div>

JavaScript

var getStringListAsInt = function(strList) {
	const n = listWeNeedToHave.split('\n');
  const cleaned = [];
  n.forEach(s => {
    if(s.length) {
      cleaned.push( s.replace('-', '') );
    }
  });

  const neededList = [];
  cleaned.forEach(str => {
    neededList.push(parseInt(str));
  });
  return neededList;
}

var listOfModelsWeHave = [
1980050,
1980051,
1980052,
1980053,
1983912,
1983913,
1983914,
1983915,
1986063,
1986064,
1986065,
1986066,
1986235,
1986236,
1986237,
1986238,
1986240,
1986241,
1986242,
1986243,
1986245,
1986246,
1986247,
1986248,
1986250,
1986251,
1986252,
1986253,
1989006,
1989030,
1989031,
1989032,
1989205,
1989206,
1989207,
1989208,
1989230,
1989231,
1989232,
1989233,
1989234,
1989246,
1989247,
1989248,
1989249,
1989280,
1989281,
1989290,
1989291,
1989292,
1989293,
1989294,
1989295,
1989296,
1989297,
1989298,
1989299,
1989300,
1989301,
1989302,
1989303,
1989304,
1989305,
1989306,
1989307,
1989308,
1989309,
1989310,
1989311,
1989312,
1989313,
1989314
];

// terminal: dir /b > print.txt to get an output file of the directories in a file
var listWeNeedToHave =`
198-9301
198-9230
198-9300
198-9302
198-9246
198-9247
198-9248
198-9249
198-9234
198-9231
198-9232
198-9233
198-6253
198-6250
198-6251
198-6252
198-9294
198-9296
198-9292
198-9295
198-9297
198-9299
198-9293
198-9298
198-9306
198-9308
198-9290
198-9307
198-9312
198-9314
198-9291
198-9313
198-6243
198-6240
198-6241
198-6242
198-9031
198-9030
198-9006
198-9032
198-6238
198-6235
198-6236
198-6237
198-9309
198-9311
198-9281
198-9310
198-9303
198-9305
198-9280
198-9304
198-6066
198-6063
198-6064
198-6065
198-6248
198-6245
198-6246
198-6247
198-3913
198-3912
198-3914
198-3915
198-9205
198-9206
198-9207
198-9208
198-0053
198-0050
198-0051
198-0052
`;

// conver string list into int array

const neededList = getStringListAsInt(listWeNeedToHave);
var missing = [];
neededList.forEach(needed => {
	var found = listOfModelsWeHave.filter(x => x === needed);
  if(found && found.length === 0) {
 ...