Update an outer variable from a nested function

A nested function can also update variables in an outer scope. Inside inner, increment the global counter by 1 so the final logged value is 1.
JavaScript
Console