IV
switch (type) {
case 'A': {
return 'Test A';
}
case 'B': {
return 'Test B';
}
default: {
console.error('Unknown type')
// добавить здесь:
return undefined
}
}
}
Size: a a a
IV
DT
DT
DT
DT
public someMethod(type: 'A' | 'B'): string {
switch (type) {
case 'A': {
return 'Test A';
}
case 'B': {
return 'Test B';
}
default: {
throw new Error('Unknown type');
}
}
}
VV
VV
VS
VV
VS
VV
VV
VV
VV
VV
DT
Вキ
Вキ
VV
VS