// --- Directions// Given an array and chunk size, divide the array into many subarrays// where each subarray is of length size// --- Examples// chunk([1, 2, 3, 4], 2) --> [[ 1, 2], [3, 4]]// chunk([1, 2, 3, 4, 5], 2) --> [[ 1, 2], [3, 4], [5]]// ch…