I noticed a lot of examples where a throw is inside a try, so the throw is never seen by anyone. Either the function should throw the error to the whole outside world (generally my preference) or return undefined, but not both!