Does this user-defined type guard produce a compile error, and what is the consequence?
function isStringArray(x: unknown): x is string[] {
return Array.isArray(x);
}
const data: unknown = [1, 2, 3];
if (isStringArray(data)) {
data[0].toUpperCase();
}