How to Create the Callback Function in JavaScript ?