creating javascript snippets