Get occurrences for 'this' keywords

Rather than defining two functions, one of which has two nested loops, I would just take a parameter for whether to include arrow functions.