A dangerous driver who crashed into another car before running away from the scene could have killed someone, a judge said.