Skip to content

Commit 21f6cd6

Browse files
committed
soften hints
1 parent 257fab4 commit 21f6cd6

33 files changed

Lines changed: 60 additions & 150 deletions

File tree

exercises/01.expressions-and-output/01.problem.hello-world/README.mdx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ is how you see the results of your code.
1010
1. Use `console.log()` to print the string `"Hello, World!"`
1111
2. Use `console.log()` to print your name as a string
1212

13-
💰 Strings are text values wrapped in quotes:
14-
15-
{/* prettier-ignore */}
16-
```ts
17-
console.log('This is a string')
18-
console.log("Double quotes work too")
19-
```
13+
💰 Strings are text values wrapped in quotes (single or double).
2014

2115
<callout-info>
2216
Which quotes you use is a matter of preference, but I typically use single

exercises/01.expressions-and-output/02.problem.escaping-strings/README.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ console.log('Name:\tKody') // Prints with a tab between
4646
3. Log "Hello" and "World" on separate lines using `\n` in a single string
4747
4. Log tab-separated column headers: "Name:" "Age:" "City:" using `\t`
4848

49-
💰 Remember: use `\'` to escape single quotes, `\"` to escape double quotes,
50-
`\n` for newlines, and `\t` for tabs!
49+
💰 Use backslash escape sequences for quotes, newlines, and tabs. The table
50+
above is your reference.
5151

5252
📜 [Escape sequences on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#escape_sequences)
5353

exercises/01.expressions-and-output/02.problem.escaping-strings/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// Learn to include special characters in strings
33

44
// 🐨 Log "It's working!" using single quotes (you'll need to escape the apostrophe)
5-
// 💰 Use \' to escape the apostrophe
5+
// 💰 Use the correct escape sequence for an apostrophe
66

77
// 🐨 Log: She said "Hi" (using double quotes for the string)
8-
// 💰 Use \" to escape the inner quotes
8+
// 💰 Use an escape sequence for the inner quotes
99

1010
// 🐨 Log "Hello" and "World" on separate lines using a single string with \n
11-
// 💰 Use \n to create a newline
11+
// 💰 Use the newline escape sequence
1212

1313
// 🐨 Log tab-separated data: Name: [tab] Age: [tab] City: (like column headers)
14-
// 💰 Use \t to create tabs between words
14+
// 💰 Use the tab escape sequence between words

exercises/01.expressions-and-output/03.problem.strings/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
// 🐨 Log your first name and last name concatenated together with a space
77

88
// 🐨 Log a sentence by concatenating multiple strings
9-
// 💰 Example: "I" + " " + "am" + " " + "learning" + " " + "to" + " " + "code"
9+
// 💰 Build the sentence from small pieces and include spaces where needed

exercises/01.expressions-and-output/05.problem.template-literals/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// A better way to build strings
33

44
// 🐨 Log "The answer is 42" using a template literal with ${40 + 2}
5-
// 💰 Use backticks: `The answer is ${expression}`
5+
// 💰 Use a template literal with interpolation for the expression
66

77
// 🐨 Log "Hello, TypeScript!" using a template literal
88

99
// 🐨 Log a math problem like "10 times 5 equals 50"
10-
// 💰 Use ${10 * 5} for the result
10+
// 💰 Compute the result inside the template literal

exercises/02.variables/01.problem.let-and-const/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// 🐨 Add the muffin to the cart (update cartTotal)
1818

1919
// 🐨 Calculate the final total with tax
20-
// 💰 finalTotal = cartTotal + (cartTotal * TAX_RATE)
20+
// 💰 Calculate the tax from cartTotal and add it to get finalTotal
2121

2222
// 🐨 Try uncommenting the line below - what happens?
2323
// TAX_RATE = 0.10

exercises/02.variables/02.problem.reassignment-vs-mutation/README.mdx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ obj.count = 2 // The object itself is modified (mutated)
2828
2. Mutate the `const` object by changing its properties
2929
3. Observe that mutation works even with `const`
3030

31-
💰 Common object mutations:
32-
33-
```ts
34-
obj.property = newValue // Change a property
35-
obj.newProp = value // Add a new property
36-
```
31+
💰 Mutation means changing properties on the existing object (not replacing the
32+
object itself).
3733

3834
📜 [MDN - Working with Objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects)

exercises/02.variables/02.problem.reassignment-vs-mutation/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ console.log('Original person:', person)
1010
// 💣 Uncomment the line above and see the TypeScript error
1111

1212
// 🐨 Now try MUTATING the object by changing the age property
13-
// 💰 person.age = 31
13+
// 💰 Update the age property on the existing object
1414

1515
// 🐨 Mutate again by changing the city
16-
// 💰 person.city = 'Portland'
16+
// 💰 Update the city property on the existing object
1717

1818
console.log('Modified person:', person)
1919

exercises/03.primitive-types/01.problem.numbers-and-strings/README.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ We need to track:
1717
4. Create a `description` variable that uses a template literal to combine the
1818
product info
1919

20-
💰 Template literals use backticks and `${expression}` for interpolation:
21-
22-
```ts
23-
const message = `Hello, ${name}!`
24-
```
20+
💰 Template literals let you embed expressions inside a string.
2521

2622
📜 [TypeScript Handbook - Everyday Types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html)

exercises/03.primitive-types/01.problem.numbers-and-strings/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
// 🐨 Create a `description` using a template literal that outputs:
1111
// "Product: TypeScript Guide | Price: $29.99 | In Stock: 100"
12-
// 💰 Use backticks ` and ${variable} syntax
12+
// 💰 Use a template literal with interpolation
1313

1414
// ✅ These console.logs will verify your work
1515
// console.log('Price:', price)

0 commit comments

Comments
 (0)