How to use console.log to simplify refactoring | Hacker News Reader