Added Javascript function to README.md