Use `defined` instead of `typeof`