If you're going to use !== here, you also need to check for a literal `undefined` with typeof.