This is actually not correct. If `'geolocation'` is not in `window.navigator` the entire expression would still evaluate to `false`, while you expect it to evaluate to `true`. Use brackets: `if (!('geolocation' in window.navigator)) {`.