Skip to content

Commit 3072845

Browse files
committed
forgot this one
1 parent c9ed6c5 commit 3072845

5 files changed

Lines changed: 7 additions & 11 deletions

File tree

  • exercises

exercises/04.control-flow/02.problem.switch-statements/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const grade: string = 'B'
1212
// - case 'D': set description to "Needs Improvement"
1313
// - case 'F': set description to "Failing"
1414
// - default: set description to "Invalid grade"
15-
// 💰 Each case should avoid falling through
15+
// 💰 Each case should avoid falling through (use `break` in each case) by adding a `break` statement
1616

1717
// console.log(`Grade ${grade}: ${description}`)
1818

exercises/05.functions/02.problem.parameters/README.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,4 @@ functions that accept clear inputs and return the right type.
1414
Return values are already familiar from 5.1—focus on **parameter types** here,
1515
but keep the return types explicit too.
1616

17-
💰 Use explicit parameter and return types in each function.
18-
19-
💰 Think about how to convert cents to a dollar amount.
20-
2117
📜 [TypeScript Handbook - More on Functions](https://www.typescriptlang.org/docs/handbook/2/functions.html)

exercises/05.functions/04.problem.arrow-functions/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function calculateTotal(subtotal: number, taxRate: number): number {
1818
}
1919

2020
// 🐨 Create an arrow function `isEven` that returns true if a number is even
21-
// 💰 Short functions can be written more concisely
21+
// 💰 Short functions can be written more concisely (use `n % 2 === 0`)
2222

2323
// 🐨 Create a function `applyToNumber` that:
2424
// - Takes a number and a transform function

exercises/05.functions/05.problem.jsdoc/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// - @param tag documenting the `a` parameter
77
// - @param tag documenting the `b` parameter
88
// - @returns tag documenting what the function returns
9-
// 💰 Documentation comments have a special format
9+
// 💰 JSDoc uses a block comment that starts with /**
1010
function add(a: number, b: number): number {
1111
return a + b
1212
}
@@ -16,7 +16,7 @@ function add(a: number, b: number): number {
1616
// - @param tag for the `name` parameter
1717
// - @returns tag
1818
// - @example tag showing how to use the function
19-
// 💰 Examples help explain how to use the function
19+
// 💰 Include an @example block that shows how to call the function
2020
function greet(name: string): string {
2121
return `Hello, ${name}!`
2222
}
@@ -40,7 +40,7 @@ function calculateCompoundInterest(
4040
// - Takes a value, min, and max
4141
// - Returns the value constrained between min and max
4242
// - Has a complete JSDoc comment with description, @param, @returns, and @example
43-
// 💰 Keep the value constrained between min and max
43+
// 💰 Use Math.min/Math.max to keep the value within range
4444

4545
// 🐨 Export your functions so we can verify your work
4646
// export { add, greet, calculateCompoundInterest, clamp }

exercises/06.void-and-never/01.problem.void-functions/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
// Functions that perform side effects return void
33

44
// 🐨 Create `logInfo` that takes a message and logs it with "[INFO]" prefix
5-
// 💰 Functions that don't return values have a special type
5+
// 💰 Functions that don't return values have a special type: `void`
66

77
// 🐨 Create `logError` that takes a message and logs it with "[ERROR]" prefix
88

99
// 🐨 Create `logWithTimestamp` that takes a message and logs it with timestamp
10-
// 💰 Include the current time in the log
10+
// 💰 Include the current time in the log using `new Date().toISOString()`
1111

1212
// ✅ Test your functions
1313
// logInfo('Application started')

0 commit comments

Comments
 (0)