Skip to content

Commit 763f307

Browse files
committed
Remove unnecessary notes about exports in string and number exercises; update README to clarify variable exporting for upcoming exercises.
1 parent ce427fe commit 763f307

7 files changed

Lines changed: 28 additions & 13 deletions

File tree

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,4 @@ console.log('Name:\tKody') // Prints with a tab between
4949
💰 Remember: use `\'` to escape single quotes, `\"` to escape double quotes,
5050
`\n` for newlines, and `\t` for tabs!
5151

52-
<callout-info>
53-
The playground also prints some extra output from `@kentcdodds/log-module`.
54-
That's normal and not part of your `console.log()` calls.
55-
</callout-info>
56-
5752
📜 [Escape sequences on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#escape_sequences)

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,3 @@
1212

1313
// 🐨 Log tab-separated data: Name: [tab] Age: [tab] City: (like column headers)
1414
// 💰 Use \t to create tabs between words
15-
16-
// 🐨 No exports needed for this exercise

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@
77

88
// 🐨 Log a sentence by concatenating multiple strings
99
// 💰 Example: "I" + " " + "am" + " " + "learning" + " " + "to" + " " + "code"
10-
11-
// 🐨 No exports needed for this exercise

exercises/01.expressions-and-output/04.problem.numbers/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@
99

1010
// 🐨 Use console.log to show the result of (10 + 5) multiplied by 2
1111
// 💰 Use parentheses to control order of operations
12-
13-
// 🐨 No exports needed for this exercise

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,3 @@
88

99
// 🐨 Log a math problem like "10 times 5 equals 50"
1010
// 💰 Use ${10 * 5} for the result
11-
12-
// 🐨 No exports needed for this exercise

exercises/02.variables/01.problem.let-and-const/README.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ const API_URL = 'https://api.example.com'
1818
```
1919

2020
📜 [MDN - const](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const)
21+
22+
<callout-info>
23+
This is the first exercise where you'll be exporting values for the tests!
24+
</callout-info>

exercises/02.variables/README.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,27 @@ Understanding this distinction helps you write predictable, bug-free code.
5555

5656
📜 For more details, see MDN's guide on [variable
5757
declarations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#declarations).
58+
59+
## Exporting Variables
60+
61+
In this and future exercises, you'll be required to see the `export`
62+
variables. This makes the variable available to other files. It's how the app
63+
displays your values and how tests verify your solutions. For now, just know
64+
that `export` shares your variable with the outside world.
65+
66+
Example of exporting a single variable:
67+
68+
```ts
69+
export const FAVORITE_COLOR = 'blue'
70+
```
71+
72+
Example of exporting multiple variables:
73+
74+
```ts
75+
const FAVORITE_COLOR = 'blue'
76+
let currentAge = 25
77+
78+
export { FAVORITE_COLOR, currentAge }
79+
```
80+
81+
We'll cover modules in depth later in the workshop series.

0 commit comments

Comments
 (0)