js snippets for testing