Update example.js

Using formally method signature