basic function of javascript