There is a task, you need to create a function that will return an array of n elements to fill in according to the pattern (the second variable that is passed to the function). So if you pass numbers, strings, etc. then everything is simple, but it is also necessary to transfer the function, and here is the problem.
function sequence(n, pattern) { let arr = new Array(n); arr.fill(pattern) return arr } sequence(4, arg => arg%2).forEach((func,i) => console.log(func(i))); Here is my code.

