code snippets for js