small snippets of Javascript learning