Improve JavaScript example.