How To Pass A Function In Javascript