Given a string, calculate the frequency of each character.
All characters should be counted. This includes lower and upper case letters, digits, whitespace, special characters, or any other distinct characters.
# --instructions--
Write a function to count the occurrences of each character in a given string.
The function should return a 2D array with each of the elements in the following form: `['char', freq]`. The character should be a string with a length of 1, and frequency is a number denoting the count.
For example, given the string "ab", your function should return `[['a', 1], ['b', 1]]`.
# --hints--
`letterFrequency` should be a function.
```js
assert(typeof letterFrequency == 'function');
```
`letterFrequency("Not all that Mrs. Bennet, however")` should return an array.
```js
assert(Array.isArray(letterFrequency('Not all that Mrs. Bennet, however')));
assert.deepEqual(letterFrequency('Not all that Mrs. Bennet, however'), [
[' ', 5],
[',', 1],
['.', 1],
['B', 1],
['M', 1],
['N', 1],
['a', 2],
['e', 4],
['h', 2],
['l', 2],
['n', 2],
['o', 2],
['r', 2],
['s', 1],
['t', 4],
['v', 1],
['w', 1]
]);
```
`letterFrequency("daughters, could ask on the ")` should return `[[' ',5],[',',1],['a',2],['c',1],['d',2],['e',2],['g',1],['h',2],['k',1],['l',1],['n',1],['o',2],['r',1],['s',2],['t',2],['u',2]]`.
```js
assert.deepEqual(letterFrequency('daughters, could ask on the '), [