<p>Given an array <code>arr</code> and a chunk size <code>size</code>, return a <strong>chunked</strong> array. A <strong>chunked</strong> array contains the original elements in <code>arr</code>, but consists of subarrays each of length <code>size</code>. The length of the last subarray may be less than <code>size</code> if <code>arr.length</code> is not evenly divisible by <code>size</code>.</p>
<p>You may assume the array is the output of <code>JSON.parse</code>. In other words, it is valid JSON.</p>
<p>Please solve it without using lodash's <code>_.chunk</code> function.</p>