Add missing 'var' declaration

added missing `var` in example.js.