JavaScript: Basics

Refactoring and Scope