forked from in-tech-gration/WDX-180
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
540 changed files
with
19,948 additions
and
904 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
curriculum/modules/javascript/denepo/_just-enough-javascript/00-errors/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Errors | ||
|
||
Errors are unavoidable in programming. In Welcome to JS most of the exercises | ||
ask you to study programs that work so you shouldn't face tooo many errors. When | ||
you do get an error, don't let this get you down. It's easier to write code that | ||
_has_ errors than to write code that _doesn't_! | ||
|
||
Understanding and fixing errors in your code will take lots of practice, in the | ||
next module you will study errors in depth. For now all you need to know about | ||
errors is: | ||
|
||
- the error _name_ and _message_ so you can search about it online. You don't | ||
need to understand everything you read about the error, but you should be able | ||
to find links about it. | ||
- finding the line where the error occurred by reading the error log and | ||
clicking on the line number . | ||
- `ctr-z`, so you can undo your error and try again. | ||
|
||
As you complete each exercise you should keep track of all the errors you | ||
encountered. Try thinking of errors as the computer's best attempt at helping | ||
you fix your mistakes. Take notes on which errors you make the most often and | ||
what you figure out to avoid them. | ||
|
||
## Run Early and Often | ||
|
||
Another strategy for dealing with errors is to run your code early and often: | ||
after every single tiny change try running the program. This helps you figure | ||
out what went wrong because the error must be related to the tiny change you | ||
just made. | ||
|
||
## ReferenceError: \_ is not defined | ||
|
||
There is one error you do not need to keep track of in your notes - | ||
`ReferenceError: _ is not defined`. You will get this error all the time, and | ||
it's not because of the code you write. we use \_ to show you where something is | ||
missing in the program, but JavaScript reads \_ as a variable that has not been | ||
declared. | ||
|
||
Instead of dreading this error, you can thank it for telling you where the next | ||
blank is! | ||
|
||
--- | ||
|
||
- Launchcode: | ||
[categories](https://education.launchcode.org/intro-to-professional-web-dev/chapters/errors-and-debugging/categories-of-errors.html), | ||
[diagnosing](https://education.launchcode.org/intro-to-professional-web-dev/chapters/errors-and-debugging/diagnosing-error-messages.html) |
63 changes: 63 additions & 0 deletions
63
...odules/javascript/denepo/_just-enough-javascript/01-comments-and-logs/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Comments and Logs | ||
|
||
Comments and logs are for developers, not for the computer. They exist to help | ||
you understand your program. | ||
|
||
Comments and logging will not change what your program does, just how easy it is | ||
to understand. | ||
|
||
--- | ||
|
||
## 🥚 Comments | ||
|
||
```js | ||
'use strict'; | ||
// comments are for people to read, not computers | ||
// these are both one-line comments | ||
|
||
// if you run or trace this snippet, nothing will happen | ||
``` | ||
|
||
```js | ||
'use strict'; | ||
/* this is a block comment | ||
block comments are useful for writing longer messages | ||
- and for | ||
- things like | ||
- lists | ||
if you run or trace this snippet nothing will happen | ||
*/ | ||
``` | ||
|
||
--- | ||
|
||
## 🥚 Logging | ||
|
||
```js | ||
'use strict'; | ||
// print a message to the browser's console | ||
console.log('-- logging --'); | ||
|
||
// an empty log | ||
console.log(); | ||
|
||
// you can log more than one thing at a time | ||
console.log('a', 'message', 'from', 'beyond'); // 'a', 'message', 'from', 'beyond' | ||
``` | ||
|
||
--- | ||
|
||
## References | ||
|
||
- Comments | ||
- [launchcode](https://education.launchcode.org/intro-to-professional-web-dev/chapters/how-to-write-code/comments.html) | ||
- [programiz](https://www.programiz.com/javascript/comments) | ||
- [javascript.info](https://javascript.info/structure#code-comments) | ||
- [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#comments) | ||
- Logging | ||
- [launchcode](https://education.launchcode.org/intro-to-professional-web-dev/chapters/how-to-write-code/output.html?highlight=log) | ||
- [programiz](https://www.programiz.com/javascript/console) | ||
- [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Console/log) |
52 changes: 52 additions & 0 deletions
52
...modules/javascript/denepo/_just-enough-javascript/02-primitive-values/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# 🥚 Primitive Values | ||
|
||
Programming computers is all about processing _data_. Data comes into a program, | ||
your program processes the data, and some new data comes out at the end. In | ||
JavaScript the most basic kinds of data are **primitive values**. When talking | ||
about a primitive value, there are two important pieces of information: | ||
|
||
- **Type**: What type of data is it? a string? a number? a boolean? undefined? | ||
- **Value**: Which one of it's type is it? Is it the _number_ **5**? or the | ||
_string_ **'5'**? | ||
|
||
You will learn more about each of these types as you work your way through Just | ||
Enough JavaScript: | ||
|
||
```js | ||
'use strict'; | ||
console.log('--- booleans: true and false ---'); | ||
console.log(true); | ||
console.log(false); | ||
``` | ||
|
||
```js | ||
'use strict'; | ||
console.log('--- strings: anything wrapped in quotation marks ---'); | ||
console.log('hello'); | ||
console.log('good bye'); | ||
console.log('12'); // <- this actually a string! | ||
console.log(''); // an empty string | ||
``` | ||
|
||
```js | ||
'use strict'; | ||
console.log('--- undefined: one way to say "there is nothing here" ---'); | ||
console.log(undefined); | ||
``` | ||
|
||
```js | ||
'use strict'; | ||
console.log('--- null: another way to say "there is nothing here" ---'); | ||
console.log(null); | ||
// we will later cover the difference between null and undefined | ||
``` | ||
|
||
```js | ||
'use strict'; | ||
console.log('--- numbers: numbers that are not wrapped in quotation marks ---'); | ||
console.log(12); | ||
console.log(3.14); | ||
console.log(0); | ||
console.log(-12); | ||
console.log(10_000_000_000); | ||
``` |
9 changes: 9 additions & 0 deletions
9
.../javascript/denepo/_just-enough-javascript/02-primitive-values/syntax/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Marking Syntax | ||
|
||
The marking exercises in this chapter will have 3 syntax features you need to | ||
study: | ||
|
||
1. **Primitives**: A small arrow _under_ the primitive. | ||
1. **Identifiers**: A line _under_ the identifier. | ||
1. **Function Calls**: A line under the identifier and a half-box under the | ||
arguments. |
Binary file added
BIN
+140 KB
...st-enough-javascript/02-primitive-values/syntax/examples/logging-primitives.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
...denepo/_just-enough-javascript/02-primitive-values/syntax/exercises/four-lines-of-code.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// #todo | ||
|
||
// prettier-ignore | ||
{ // so prettier does not remove the extra spacing | ||
|
||
'use strict'; | ||
|
||
|
||
console.log('hello'); | ||
|
||
|
||
console.log(true); | ||
|
||
|
||
console.log(); | ||
|
||
|
||
console.log('are you hungry?', false); | ||
|
||
|
||
} |
5 changes: 5 additions & 0 deletions
5
...m/modules/javascript/denepo/_just-enough-javascript/02-primitive-values/syntax/study.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"--defaults": { | ||
".js": "highlight" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...dules/javascript/denepo/_just-enough-javascript/03-operators/0-syntax/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Marking Syntax | ||
|
||
The marking exercises in this chapter will have 4 syntax features you need to | ||
study: | ||
|
||
1. **Primitives**: A small arrow _under_ the primitive. | ||
1. **Identifiers**: A line _under_ the identifier. | ||
1. **Function Calls**: A line under the identifier and a half-box under the | ||
arguments. | ||
1. **Operators**: A small arrow _above_ on the operator. |
Binary file added
BIN
+118 KB
...t-enough-javascript/03-operators/0-syntax/examples/primitives-and-operators.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions
27
...cript/denepo/_just-enough-javascript/03-operators/0-syntax/exercises/six-lines-of-code.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// #todo | ||
|
||
// prettier-ignore | ||
{ // so prettier does not remove the extra spacing | ||
|
||
'use strict'; | ||
|
||
|
||
2 + 2; | ||
|
||
|
||
true === true; | ||
|
||
|
||
2 === '2'; | ||
|
||
|
||
console.log('hel' + 'o!'); | ||
|
||
|
||
console.log(2 === 2); | ||
|
||
|
||
console.log(true === false); | ||
|
||
|
||
} |
5 changes: 5 additions & 0 deletions
5
...iculum/modules/javascript/denepo/_just-enough-javascript/03-operators/0-syntax/study.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"--defaults": { | ||
".js": "highlight" | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...culum/modules/javascript/denepo/_just-enough-javascript/03-operators/1-blanks/addition.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// #todo | ||
|
||
'use strict'; | ||
|
||
// your answers should only include numbers and + | ||
|
||
console.log('--- find 5 ways to log the number 5 ---'); | ||
// examples | ||
console.log(5); | ||
console.log(0 + 2 + 3); | ||
// exercises | ||
console.log(); | ||
console.log(); | ||
console.log(); | ||
console.log(); | ||
console.log(); | ||
|
||
console.log('--- find 4 ways to log the number 4 ---'); | ||
// examples | ||
console.log(4); | ||
console.log(2 + 2); | ||
// exercises | ||
console.log(); | ||
console.log(); | ||
console.log(); | ||
console.log(); |
24 changes: 24 additions & 0 deletions
24
.../modules/javascript/denepo/_just-enough-javascript/03-operators/1-blanks/concatenation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// #todo | ||
|
||
'use strict'; | ||
|
||
// your answers should only include strings and + | ||
|
||
console.log('--- find 3 ways to log "hello" ---'); | ||
// examples | ||
console.log('hello'); | ||
console.log('h' + 'ello'); | ||
// exercises | ||
console.log(); | ||
console.log(); | ||
console.log(); | ||
|
||
console.log('--- find 4 ways to log "good bye" ---'); | ||
// examples | ||
console.log('good bye'); | ||
console.log('good' + ' ' + 'bye'); | ||
// exercises | ||
console.log(); | ||
console.log(); | ||
console.log(); | ||
console.log(); |
29 changes: 29 additions & 0 deletions
29
...odules/javascript/denepo/_just-enough-javascript/03-operators/1-blanks/strict-equality.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// #todo | ||
|
||
'use strict'; | ||
|
||
// your answers must include ===, but can use any type | ||
|
||
console.log('--- write 5 comparisons that evaluate to true ---'); | ||
// examples | ||
console.log('hello' === 'hello'); | ||
console.log('Bye' === 'Bye'); | ||
console.log(1 === 1.0); | ||
// exercises | ||
console.log(); | ||
console.log(); | ||
console.log(); | ||
console.log(); | ||
console.log(); | ||
|
||
console.log('--- write 5 comparisons that evaluate to false ---'); | ||
// examples | ||
console.log('hello' === 'hello '); | ||
console.log('Bye' === 'bye'); | ||
console.log(1 === 1.1); | ||
// exercises | ||
console.log(); | ||
console.log(); | ||
console.log(); | ||
console.log(); | ||
console.log(); |
11 changes: 11 additions & 0 deletions
11
...iculum/modules/javascript/denepo/_just-enough-javascript/03-operators/1-blanks/study.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"study": { | ||
"trace": false, | ||
"ask": false, | ||
"loopGuard": false, | ||
"parsons": false, | ||
"flowchart": false, | ||
"variables": false, | ||
"table": false | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
curriculum/modules/javascript/denepo/_just-enough-javascript/03-operators/1-blanks/typeof.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// #todo | ||
|
||
'use strict'; | ||
|
||
// your answers must use typeof, but can use any values | ||
console.log('-- write 2 values with the type "boolean" --'); | ||
console.log(typeof _); // 'boolean' | ||
console.log(typeof _); // 'boolean' | ||
|
||
console.log('-- write 1 value with the type "object" --'); | ||
console.log(typeof _); // 'object' | ||
|
||
console.log('-- write 5 values with the type "string" --'); | ||
// examples | ||
console.log(typeof 'hello'); // 'string' | ||
console.log(typeof ''); // 'string' | ||
// exercises | ||
console.log(typeof _); // 'string' | ||
console.log(typeof _); // 'string' | ||
console.log(typeof _); // 'string' | ||
console.log(typeof _); // 'string' | ||
console.log(typeof _); // 'string' | ||
|
||
console.log('-- write 5 values with the type "number" --'); | ||
// examples | ||
console.log(typeof 0); // 'number' | ||
console.log(typeof 18.5); // 'number' | ||
// exercises | ||
console.log(typeof _); // 'number' | ||
console.log(typeof _); // 'number' | ||
console.log(typeof _); // 'number' | ||
console.log(typeof _); // 'number' | ||
console.log(typeof _); // 'number' |
Oops, something went wrong.