Skip to content

Commit f21ef23

Browse files
authoredJul 7, 2017
Use screenshots of IDE terminal
Fixes #15
1 parent 35e6de1 commit f21ef23

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed
 

‎README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,35 @@ First, we need to practice greeting everyone. (I don't know about you, but I som
1919

2020
One might think that we could just type
2121

22-
``` javascript
22+
```js
2323
Hello, everybody!
2424
```
2525

2626
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.)
2727

2828
You should see something like
2929

30-
``` shell
30+
```
3131
Uncaught ReferenceError: Hello is not defined(…)
3232
```
3333

3434
Well, that won't work. (This is why we practice!) In order to greet our guests, we need to tell JavaScript that we're using a **string**. A string is a collection of characters (letters, numbers, and symbols) wrapped in single or double quotes (or, as we'll see, in back ticks). So to greet everyone, we can write,
3535

36-
``` javascript
36+
```js
3737
'Hello, everybody!'
3838
```
3939

4040
or
4141

42-
``` javascript
42+
```js
4343
"Hello, everybody!"
4444
```
4545

4646
Single or double quotation marks can contain a string variable..
4747

4848
What if we want to say hi to a special guest, like Neil deGrasse Tyson? When we wrap strings in single or double quotes, we can join them together using the `+` operator:
4949

50-
``` javascript
50+
```js
5151
var specialGuest = "Neil deGrasse Tyson"
5252
"Hello, " + specialGuest + "!" // "Hello, Neil deGrasse Tyson!"
5353
```
@@ -62,7 +62,7 @@ Alternatively, you can press `ctrl + L` or `command + K`. As long as you don't r
6262

6363
When we wrap strings in back ticks, we can use placeholders (`${}`) and insert variables or evaluated JavaScript directly:
6464

65-
``` javascript
65+
```js
6666
var specialGuest = "Neil deGrasse Tyson";
6767

6868
`Hello, ${specialGuest}! High ${3 + 2}!` // "Hello, Neil deGrasse Tyson! High 5!"
@@ -82,7 +82,7 @@ All three tests have failed! This is okay, and it's expected — you haven't wri
8282

8383
In `index.js`, you'll see five lines of code:
8484

85-
``` javascript
85+
```js
8686
var greeting = "";
8787

8888
var specialGuest = "Neil deGrasse Tyson"
@@ -98,11 +98,11 @@ Each line has a test associated with it. When the tests fail, they show us what
9898

9999
When you first run `learn`, you should see something like this:
100100

101-
![test fail](https://curriculum-content.s3.amazonaws.com/skills-based-js/javascript-strings-lab/javascript-strings-lab-test.png)
101+
![All tests failing.](https://user-images.githubusercontent.com/17556281/27979675-b6575498-6345-11e7-8c9d-052c2d4d3e96.png)
102102

103103
Let's walk through that first error together. First, we see the test title:
104104

105-
``` bash
105+
```bash
106106
1) strings defines `greeting`:
107107
```
108108

@@ -112,7 +112,7 @@ we're handling strings.
112112

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

115-
``` bash
115+
```bash
116116
AssertionError: '!' == 'Hello, everybody!'
117117
+ expected - actual
118118

@@ -134,13 +134,13 @@ Next, the title tells us that `index.js` "defines `greeting`." Let's look in `in
134134

135135
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
136136

137-
``` javascript
137+
```js
138138
var greeting = "Hello, everybody!";
139139
```
140140

141141
save the file, and rerun your tests. You should see
142142

143-
![first test passes!](https://curriculum-content.s3.amazonaws.com/skills-based-js/javascript-strings-lab/javascript-strings-lab-test-pass.png)
143+
![First test passes!](https://user-images.githubusercontent.com/17556281/27979674-b65255f6-6345-11e7-8fca-d71760c514ef.png)
144144

145145
Nice! You got the first test to pass.
146146

0 commit comments

Comments
 (0)
Failed to load comments.