Update example.js

Addded the config variable declaration before its use; added some missing semicolons.