Conversion of an array into two-dimensional in a calendar in JavaScript

In the previous lesson, we made an array filled on the right and left with empty strings. Let's now convert this array into a two-dimensional one. Let's make the following chunk function for this:

javascriptfunction chunk(arr, n) {
  // n - a number of elements in subarray
}

You can use our function like this:

javascriptlet res = chunk(normalize(arr, firstWeekDay, 6 - lastWeekDay), 7));
console.log(res);
Задание 1

Implement the described function chunk and check its operation.