SOme useful code parts of JavaScript