Shouldn't the last comparison be strict (`===`)?