let arr = ['katya', 'Karolina', 'Vladislav', 'Anna'];
let num = arr.filter(function(elem) {
return elem > ;
});
console.log(num);
`${arr}`.match(/\b\w{5}\b/g) || []
// или
arr.reduce((acc, n) => (n.length ^ '0b101' || acc.push(n), acc), [])
// или
arr.filter(n => n[4] && !n[-~4])
// или
arr.filter(RegExp.prototype.test.bind(/^.....$/))
// или
arr.reduce((acc, n) => ((acc[n.search('$')] ??= []).push(n), acc), {})[5] ?? []
// или
(function xxx(arr, i = 0) {
return arr.hasOwnProperty(i)
? [].concat(5 - [].push(...arr[i]) ? [] : arr[i], xxx(arr, i + 1))
: [];
})(arr)
let arr = ['katya', 'Karolina', 'Vladislav', 'Anna'];
let num = arr.filter(function(elem) {
return elem.length === 5;
});
console.log(num);