Javascript function: first commit