console.js: specify `this` in .forEach, keep vars in scope
Merge pull request #1943 from erikdesjardins/console-fixes

console.js fixes