backend feladat

This commit is contained in:
magdo
2026-02-13 19:14:10 +01:00
parent 6afdef6a30
commit 622d4a3321
877 changed files with 87856 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
module.exports = function (xs, fn) {
var res = [];
for (var i = 0; i < xs.length; i++) {
var x = fn(xs[i], i);
if (isArray(x)) res.push.apply(res, x);
else res.push(x);
}
return res;
};
var isArray = Array.isArray || function (xs) {
return Object.prototype.toString.call(xs) === '[object Array]';
};