Which are in?

This commit is contained in:
2017-09-17 19:48:49 +02:00
parent 1697569103
commit 024291e7bc

6
which-are-in/index.js Normal file
View File

@@ -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));
}