Correct JavaScript documentation, correct error in functions, usage of function