fork download
  1. let text = `Ukraine[a] is a country in Eastern Europe. It is the second-largest country in Europe after Russia, which borders it to the east and northeast.[b] Ukraine also borders Belarus to the north; Poland and Slovakia to the west; Hungary, Romania and Moldova[c] to the southwest; and the Black Sea and the Sea of Azov to the south and southeast.[d] Kyiv is the nation's capital and largest city, followed by Kharkiv, Odesa, and Dnipro. Ukraine's official language is Ukrainian.`;
  2. let words = text.match(/[A-Za-z]+/g) || [];
  3. let allowedStart = ["I", "Y", "K", "L", "M", "N"];
  4. let IDN = words.filter(word =>
  5. allowedStart.some(letter => word.startsWith(letter))
  6. );
  7. console.log("Масив IDN:", IDN);
Success #stdin #stdout 0.05s 19564KB
stdin
Standard input is empty
stdout
Масив IDN: It,Moldova,Kyiv,Kharkiv