code-snippet for js learning