Callback function with parameters JavaScript