Skip to content

Commit c8a8027

Browse files
committed
Enums and functions
1 parent 222cf1c commit c8a8027

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

typescript/Resume/dist/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ var Size;
1313
})(Size || (Size = {}));
1414
let mySize = Size.Medium;
1515
console.log(mySize);
16+
function fToC(f = 100) {
17+
return (f - 32) + 5 / 9;
18+
}
19+
console.log(fToC(50));
20+
console.log(fToC());

typescript/Resume/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,10 @@ enum Size {Small = 1, Medium = 2, Large = 3}
1414
let mySize = Size.Medium
1515
console.log(mySize)
1616

17+
//Functions
18+
function fToC(f: number = 100): number { //Default value for parameter f
19+
return (f-32)+5/9
20+
}
21+
22+
console.log(fToC(50))
23+
console.log(fToC()) // no parameter value

typescript/Resume/tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@
8585
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
8686
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
8787
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
88-
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
89-
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
88+
"noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
89+
"noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
9090
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
91-
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
91+
"noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
9292
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
9393
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
9494
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */

0 commit comments

Comments
 (0)