Skip to content

Commit cc390d4

Browse files
committed
corrected spelling errors flagged by spell checker
1 parent e93b400 commit cc390d4

6 files changed

Lines changed: 54 additions & 54 deletions

File tree

fundamentals/conditional_execution.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if (distance < 10) {
3737
}
3838
```
3939

40-
A condition can take more complex forms, using `&&` (logival AND) and `||` (logical OR) operators:
40+
A condition can take more complex forms, using `&&` (logical AND) and `||` (logical OR) operators:
4141

4242
```js
4343
if (distance < 10 && !raining) {
@@ -70,16 +70,16 @@ if (distance < 10) {
7070
if (raining) {
7171
console.log('I will go public transportation.');
7272
} else {
73-
console.log('I will walk.');
73+
console.log('I will walk.');
7474
}
7575
} else {
76-
console.log('I will go by car.');
76+
console.log('I will go by car.');
7777
}
7878
```
7979

8080
> As (nested) `if` statements can become quite complex it is very important that you indent your source code so that there can be no confusion about which statement blocks are executed for each condition, as was done in the examples.
8181
82-
>More informaton on MDN: [if...else](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else)
82+
>More information on MDN: [if...else](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else)
8383
8484
## The conditional (ternary) operator
8585

@@ -91,7 +91,7 @@ The general format is:
9191
condition ? expr1 : expr2
9292
```
9393

94-
('ternary' means: _composed of three parts_)
94+
('ternary' means: _composed of three parts_)
9595

9696
It is often used in combination with an assignment, as in this example:
9797

@@ -108,7 +108,7 @@ It is **not** recommended to use the conditional operator if you do not intend t
108108
age < 1 ? console.log('new') : console.log('used');
109109
```
110110

111-
>More informaton on MDN: [Conditional (ternary) Operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator)
111+
>More information on MDN: [Conditional (ternary) Operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator)
112112
113113
## The switch statement
114114

@@ -151,11 +151,11 @@ Depending on the value of the expression specified in the `switch` clause, one o
151151

152152
The `default` statement at the end is executed when none of the preceding cases hold true. The `default` statement is not strictly required, but is a best practice to always specify one.
153153

154-
>More informaton on MDN: [switch](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch)
154+
>More information on MDN: [switch](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch)
155155
156156
## truthy, falsy
157157

158-
**truthy**: 'sort of' `true`
158+
**truthy**: 'sort of' `true`
159159
**falsy**: 'sort of' `false`
160160

161161
From MDN:
@@ -182,4 +182,4 @@ if (x) {
182182
}
183183
```
184184

185-
>More informaton on MDN: [Truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), [Falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy)
185+
>More information on MDN: [Truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), [Falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy)

fundamentals/javascript_review.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
You'll need to know the following before starting the Node class (remember Node is just JavaScript in a different environment - and you KNOW JS already - right?!?!)
44

5-
```
5+
```
66
From Jason:
7-
jason [9:11 AM]
7+
jason [9:11 AM]
88
@timirkaria the most important topics will be sync/async and ajax. That and basic syntax (named and anonymous functions, callbacks, scope) should be sufficient!
99
```
1010

1111
### AJAX
12-
Stands for *A*syncrhonous *J*avascript *A*nd *X*ml (think of XML as the old JSON) but now it's AJA*J* but that doesn't sound as good.
12+
Stands for *A*synchronous *J*avascript *A*nd *X*ml (think of XML as the old JSON) but now it's AJA*J* but that doesn't sound as good.
1313

1414
So here's an example of a SYNCHRONOUS request (it waits for the request to come back before continuing)
1515

@@ -29,7 +29,7 @@ console.log('Made the request')
2929

3030
```
3131

32-
And here's an example of an ASYNCHRONOUS version of the same request as above. Look carefully at the output.
32+
And here's an example of an ASYNCHRONOUS version of the same request as above. Look carefully at the output.
3333

3434
```js
3535
var SECRET_MESSAGE_URL = 'https://gist.githubusercontent.com/tkaria/08325583e7411f7de6b80871780fd917/raw/61dae2869ae5013652bbeba1da2487097d8869b1/SecretMessage.txt'
@@ -52,16 +52,16 @@ xhr.send(null);
5252
console.log('Made the request');
5353
```
5454

55-
### What's happening here?
55+
### What's happening here?
5656
As always - read the docs first...
57-
`https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest`
57+
`https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest`
5858

5959
Create a new request and open it (lines 2 and 3)
60-
Tell the request object what function to call when when the contents of the request are loaded. Inside the ANONYMOUS function which takes a parameter `e` we check the response code from the request (this is just HTTP stuff - nothing special). If the reponse code is good (200) then we print what we got.
60+
Tell the request object what function to call when when the contents of the request are loaded. Inside the ANONYMOUS function which takes a parameter `e` we check the response code from the request (this is just HTTP stuff - nothing special). If the response code is good (200) then we print what we got.
6161

62-
More interesting is the order of the print statements. In the first example we saw the message `Received the response` **BEFORE** we saw the `Made the request` message because the program waited to get the response and print it before continuing to run.
62+
More interesting is the order of the print statements. In the first example we saw the message `Received the response` **BEFORE** we saw the `Made the request` message because the program waited to get the response and print it before continuing to run.
6363

64-
In this case we see the `Made the request` message before we see the response because the program keeps running while waiting for the response. When the response is finally received it is printed before writing the `Received the response` to the console.
64+
In this case we see the `Made the request` message before we see the response because the program keeps running while waiting for the response. When the response is finally received it is printed before writing the `Received the response` to the console.
6565

6666
Note that we used an anonymous function here - it has no name. There's nothing special about an anonymous function. We could equally use a named function in the above example:
6767

@@ -80,7 +80,7 @@ function NOT_ANONYMOUS_ON_LOAD_FUNCTION(parameter) {
8080
}
8181
}
8282
xhr.open("GET", SECRET_MESSAGE_URL, true);
83-
xhr.onload = NOT_ANONYMOUS_ON_LOAD_FUNCTION; // Note: we are not CALLING the function - there are no ()
83+
xhr.onload = NOT_ANONYMOUS_ON_LOAD_FUNCTION; // Note: we are not CALLING the function - there are no ()
8484
// We'll leave the error function the way it is and you can change it to a named function
8585
xhr.onerror = function (e) {
8686
console.error(xhr.statusText);
@@ -90,14 +90,14 @@ console.log('Made the request');
9090

9191
```
9292

93-
### The big idea:
93+
### The big idea:
9494

95-
#### Sync / Async
96-
Make requests without waiting for the response and just get "notified" when the response happens. That's the asyncrhonous part - don't wait for it and stop everything else just let me know when it happens. How can the computer let you know? You tell it what to do when the async function is ready (has something to say - success or failure)
95+
#### Sync / Async
96+
Make requests without waiting for the response and just get "notified" when the response happens. That's the asynchronous part - don't wait for it and stop everything else just let me know when it happens. How can the computer let you know? You tell it what to do when the async function is ready (has something to say - success or failure)
9797

9898
#### Named and anonymous functions
99-
Some functions have names and some don't. Sometimes you just want to use a function to pass it to another function so you don't need to name it. It never needs to be called outside of the function that you're passing it to so it doesn't need a name.
100-
The simplest asynchonous function that you will see all over the place is called `setTimeout` (right now you should be reaching for a new tab and typing `MDN setTimeout` into Google). Be patient when running the below - it takes 3 seconds...
99+
Some functions have names and some don't. Sometimes you just want to use a function to pass it to another function so you don't need to name it. It never needs to be called outside of the function that you're passing it to so it doesn't need a name.
100+
The simplest asynchronous function that you will see all over the place is called `setTimeout` (right now you should be reaching for a new tab and typing `MDN setTimeout` into Google). Be patient when running the below - it takes 3 seconds...
101101

102102
For example (using a named function):
103103
```js
@@ -130,20 +130,20 @@ console.log('After timeoutFunction');
130130
What to do when the result of an async request is returned. Remember that requests can succeed as well as fail. Plan for (AND TEST) both.
131131

132132
#### Scope
133-
I think we covered this pretty well with our discussion of closures in the last class but let me know if you need more.
133+
I think we covered this pretty well with our discussion of closures in the last class but let me know if you need more.
134134

135135
## Recap
136-
Read this - you may not understand it all but please read it before you read anything else about closures. The reason is that this is source material - this is the primary documentation. It is written very technically and in a bit of a boring way but there's a reason (as we talked about in class). The reason is to be clear so the language is precise and technical. It's OK if you don't get it now but just read it and it will stay in the back of your head.
136+
Read this - you may not understand it all but please read it before you read anything else about closures. The reason is that this is source material - this is the primary documentation. It is written very technically and in a bit of a boring way but there's a reason (as we talked about in class). The reason is to be clear so the language is precise and technical. It's OK if you don't get it now but just read it and it will stay in the back of your head.
137137
https://developer.mozilla.org/en/docs/Web/JavaScript/Closures
138138

139-
Please TYPE these exercises - do NOT copy and paste. BEFORE you run them please make a guess in your head about what will happen.
139+
Please TYPE these exercises - do NOT copy and paste. BEFORE you run them please make a guess in your head about what will happen.
140140
```js
141141
function init() {
142142
var name = 'Mozilla'; // name is a local variable created by init
143143
function displayName() { // displayName() is the inner function, a closure
144-
alert(name); // use variable declared in the parent function
144+
alert(name); // use variable declared in the parent function
145145
}
146-
displayName();
146+
displayName();
147147
}
148148
init();
149149
```
@@ -152,18 +152,18 @@ init();
152152
function init() {
153153
var name = 'Mozilla'; // name is a local variable created by init
154154
function displayName() { // displayName() is the inner function, a closure
155-
alert(name); // use variable declared in the parent function
155+
alert(name); // use variable declared in the parent function
156156
}
157157
}
158-
displayName();
158+
displayName();
159159
```
160160

161161
```js
162162
var name = 'Hack your future'
163163
function init() {
164164
var name = 'Mozilla'; // name is a local variable created by init
165165
function displayName() { // displayName() is the inner function, a closure
166-
alert(name); // use variable declared in the parent function
166+
alert(name); // use variable declared in the parent function
167167
}
168168
displayName();
169169
}
@@ -174,37 +174,37 @@ init();
174174
var name = 'Hack your future'
175175
function init(name) {
176176
function displayName(name) { // displayName() is the inner function, a closure
177-
alert(name); // use variable declared in the parent function
177+
alert(name); // use variable declared in the parent function
178178
}
179179
displayName(name);
180180
}
181181
init('Hack your future again')
182182
```
183183

184-
Now read this: http://stackoverflow.com/questions/11488014/asynchronous-process-inside-a-javascript-for-loop
184+
Now read this: http://stackoverflow.com/questions/11488014/asynchronous-process-inside-a-javascript-for-loop
185185

186-
And try out the examples - please make SURE you understand what is happening. Ask questions if you do not.
186+
And try out the examples - please make SURE you understand what is happening. Ask questions if you do not.
187187

188188
Same instructions as above but now for Arrow functions (remember this is not intended to confuse you - it's just code).
189189

190190
### Arrow functions
191191
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions
192-
Then read this.
192+
Then read this.
193193
http://stackoverflow.com/questions/22939130/when-should-i-use-arrow-functions-in-ecmascript-6/28135120#28135120
194194

195-
This is a normal function:
195+
This is a normal function:
196196
```js
197197
function sayHello(name) {
198198
return 'Hello ' + name;
199199
}
200200
```
201201

202-
Same as above with arrow (fat arrow) notation - shorthand notation. This is easy to mess up. Notice no return.
202+
Same as above with arrow (fat arrow) notation - shorthand notation. This is easy to mess up. Notice no return.
203203
```js
204204
var sayHello2 = (name) => 'Hello ' + name;
205205
```
206206

207-
Same as above with arrow (fat arrow) notation - shorthand notation. Better - easier to read - with return.
207+
Same as above with arrow (fat arrow) notation - shorthand notation. Better - easier to read - with return.
208208
```js
209209
var sayHello2 = (name) => {return 'Hello ' + name;}
210210
```
@@ -216,7 +216,7 @@ function Person(firstName) {
216216
}
217217
```
218218

219-
Looks the same but what happens? See if you can figure out why from reading the documentation.
219+
Looks the same but what happens? See if you can figure out why from reading the documentation.
220220
```js
221221
var Person = (firstName) => {this.firstName = firstName}
222222
```
@@ -232,7 +232,7 @@ for (i = 0; i < 3; i++) {
232232
}
233233
```
234234

235-
### Make the above function do what we think it should do.
235+
### Make the above function do what we think it should do.
236236

237237
### Return examples
238238
```js
@@ -247,7 +247,7 @@ function f2(x) {
247247
}
248248
```
249249

250-
### Static members
250+
### Static members
251251
http://odetocode.com/blogs/scott/archive/2015/02/02/static-members-in-es6.aspx
252252

253253
### Closures examples
@@ -256,7 +256,7 @@ https://jsfiddle.net/78dg25ax/?utm_source=website&utm_medium=embed&utm_campaign=
256256
### Why closures are helpful with async code:
257257
http://stackoverflow.com/questions/13343340/calling-an-asynchronous-function-within-a-for-loop-in-javascript
258258

259-
### Promises
259+
### Promises
260260
http://stackoverflow.com/questions/13343340/calling-an-asynchronous-function-within-a-for-loop-in-javascript
261261
https://www.youtube.com/watch?v=WBupia9oidU
262262

fundamentals/loops.md

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

33
A loop is a programming construct to perform a repetitive action. Often (but not always) the repetitive action involves accessing or manipulating the individual elements of an array.
44

5-
We will use the array of month names given below to illustrate the various types of loop constructs available in JavaScript. In the examples we will print out the names of the invidual months using a `console.log` statement.
5+
We will use the array of month names given below to illustrate the various types of loop constructs available in JavaScript. In the examples we will print out the names of the individual months using a `console.log` statement.
66

77
```js
88
const months = [

fundamentals/map_filter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ The key to understanding the **reduce()** method is in the line:
120120
accumulator = reducerFn(accumulator, this[i], i, this);
121121
```
122122

123-
In the case we don't need the current loop index and the subject array in the reducer function (which is oftent the case), we can simplify this to:
123+
In the case we don't need the current loop index and the subject array in the reducer function (which is often the case), we can simplify this to:
124124

125125
```js
126126
accumulator = reducerFn(accumulator, this[i]);

0 commit comments

Comments
 (0)