diff --git a/which-are-in/index.js b/which-are-in/index.js new file mode 100644 index 0000000..68c8dce --- /dev/null +++ b/which-are-in/index.js @@ -0,0 +1,6 @@ +// https://www.codewars.com/kata/which-are-in/train/javascript + +function inArray(a1, a2) { + let s2 = a2.join('_'); + return a1.filter(w => 0 <= s2.indexOf(w)).sort((a, b) => a.localeCompare(b)); +} \ No newline at end of file