javascript test snippets