fix typo in demo-basic
fix a typo in demo-basic and cleanup the codebase
add jshint to make sure code's quality, and did refactor