Skip to content

Commit c2c25f5

Browse files
author
pletcher
committed
strings.js -> index.js
1 parent 75322e9 commit c2c25f5

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ One might think that we could just type
2525
Hello, everybody!
2626
```
2727

28-
in our browser's console and be done with it. Give it a try. (If you're on a Mac, that would be `Command` + `Option` + `J` together.)
28+
in our browser's console and be done with it. Give it a try. (If you're on a Mac, that would be `Command` + `Option` + `J` together.)
2929

3030
You should see something like
3131

@@ -74,15 +74,15 @@ This is called _interpolation_.
7474

7575
## Lab
7676

77-
You'll find a file called `strings.js` in this directory. Your mission, should you choose to accept it, is to get its tests (in `tests/strings-test.js`) to pass.
77+
You'll find a file called `index.js` in this directory. Your mission, should you choose to accept it, is to get its tests (in `tests/index-test.js`) to pass.
7878

7979
You can run the tests using the `learn` command in your terminal or the Learn IDE. Give that a go now.
8080

8181
![waiting](http://i.giphy.com/9c830567WqLCw.gif)
8282

8383
All three tests have failed! This is okay, and it's expected — you haven't written any code yet, after all.
8484

85-
In `strings.js`, you'll see four lines of code:
85+
In `index.js`, you'll see four lines of code:
8686

8787
``` javascript
8888
var greeting = "!";
@@ -108,7 +108,9 @@ Let's walk through that first error together. First, we see the test title:
108108
1) strings defines `greeting`:
109109
```
110110

111-
The title tells us what the test expects our code to do. In this case, "strings" refers to the file that we've been working in, `strings.js` — it's common to refer to name files by what they contain, and makes reasoning about their names super easy.
111+
The title tells us what the test expects our code to do. In this case,
112+
"strings" refers to the general problem space in which we're working —
113+
we're handling strings.
112114

113115
Continuing on with the test output, we can now make better sense of the next few lines:
114116

@@ -129,9 +131,9 @@ What is that thing? The test expected the empty string, `''`, to be equal to the
129131

130132
But reading on, we only see `+Hello, everybody!` — what's going on? Why isn't there any `- actual` output? Well, there _was_ no actual output — it's just an empty string! That must be the problem!
131133

132-
Next, the title tells us that `strings.js` "defines `greeting`." Let's look in `strings.js` — sure enough, we see, at the top of the file, `var greeting = "";`. Seems like a reasonable place to start.
134+
Next, the title tells us that `index.js` "defines `greeting`." Let's look in `index.js` — sure enough, we see, at the top of the file, `var greeting = "";`. Seems like a reasonable place to start.
133135

134-
What if, instead of assigning `""` to `greeting`, we assign `"Hello, everybody!"`, like the test expects. Go ahead and change that line in `strings.js` so it reads
136+
What if, instead of assigning `""` to `greeting`, we assign `"Hello, everybody!"`, like the test expects. Go ahead and change that line in `index.js` so it reads
135137

136138
``` javascript
137139
var greeting = "Hello, everybody!";
@@ -143,7 +145,7 @@ save the file, and rerun your tests. You should see
143145

144146
Nice! You got the first test to pass.
145147

146-
Now use the skills that you learned above to read through the rest of the test output and fix those errors, too! Always remember to save your file before re-running your tests.
148+
Now use the skills that you learned above to read through the rest of the test output and fix those errors, too! Always remember to save your file before re-running your tests.
147149

148150
**NOTE**: Because we're dealing with some low-level language features, you might spot some easy ways to "cheat" on this lab, or this lab might seem frustratingly easy. We've given you some starter code to point you in the right direction — try to solve the lab as intended! You can then compare your solution with ours (found in the `solution` branch of this repository).
149151

0 commit comments

Comments
 (0)