We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ecfcda commit c80af15Copy full SHA for c80af15
modules/20-functions/85-function-overloads/description.ru.yml
@@ -33,11 +33,13 @@ theory: |
33
const concat: {
34
(a: number, b: number): string;
35
(a: string, b: string): string;
36
- } = (a: unknown, b: unknown) => (
37
- typeof a === 'string'
38
- ? `${a}${b}`
39
- : `${a.toFixed()}${b.toFixed()}`
40
- )
+ } = (a: unknown, b: unknown) => {
+ if (typeof a === 'number') {
+ return `${a.toFixed()}${b.toFixed()}`;
+ }
+
41
+ return `${a}${b}`;
42
43
44
// с использованием алиасов
45
type Overloaded = {
0 commit comments