Javascript does not have a param by reference