how to call anonymous function in javascript