functions code bricks for JavaScript