Skip to content

Commit fdcd5f9

Browse files
committed
Update for j-foundations
1 parent 96eeccb commit fdcd5f9

File tree

4 files changed

+320
-144
lines changed

4 files changed

+320
-144
lines changed

Diff for: dev-environments.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Developer Environments
2+
3+
## Vocabulary
4+
5+
- **repository**: The central location where your files are stored. You can think of it as a folder.
6+
- **source code editor**: A text editor program designed specifically for editing source code of computer programs. (Think MS Word for code)
7+
8+
## Lecture Slides + Directions
9+
10+
[Slides are here](https://docs.google.com/presentation/d/e/2PACX-1vQWCRKZqhKU_B7-f72DZ5Aq34yxXys7yHed51cOeLEqTyBsIoay9a8LKyOXJMaM1grw8DVhqrSYSiV0/embed?start=false&loop=false&delayms=3000)
11+
12+
## Basic Requirements
13+
14+
1. Download [this zip file](https://bit.ly/ccjfoundations)
15+
1. Extract the files to your desktop
16+
1. Open the repository in Visual Studio Code
17+
1. Edit a JavaScript file, save it, and refresh the html page in the browser to see the change
18+
1. Create a second `console.log` and have it show up in the browser
19+
20+
## Review
21+
22+
1. What does `console.log` do?

Diff for: foundations.md

+80-46
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
# Foundations of Programming
22

3-
## Objectives
4-
5-
- Understand what a program is
6-
- Understand why JavaScript is a useful programming language for beginners to learn
7-
- Describe and use JavaScript _expressions_
8-
- Describe and use arithmetic _operators_
9-
- Describe and use `number` and `string` data _types_
10-
113
## Lecture Slides
124

13-
[Slides are here](https://docs.google.com/presentation/d/e/2PACX-1vQR9MVY1wprMhweN278XrP587sizLmdR1qxVmW2RDoArrz2Exxwy4wi1fZXgD0_-eGxRzMo6-2dzvLk/pub?start=false&loop=false&delayms=3000)
5+
[Slides are here](https://docs.google.com/presentation/d/e/2PACX-1vSMm-b3hSJwjgc4TQe7YnXfVjpdgklt4Ma30sfWULU4jDxt0XplMXLX0vMem6cVBj8LDlbhtLSNpb4s/embed?start=false&loop=false&delayms=3000)
146

157
## Exercises
168

@@ -26,57 +18,99 @@ Can you try to define the following in your own words?
2618
- _operator_
2719
- _type_
2820

29-
#### `number`s & `string`s
21+
#### numbers & strings
3022

31-
##### `number`s
23+
##### numbers
3224

33-
1. Enter the below expressions, line by line, into your Chrome console. What happens for each?
25+
1. Enter the following expressions, line by line, into your Chrome console. What happens for each?
3426

35-
```js
36-
4 + 10;
37-
1 * 3;
38-
12 * 4;
39-
4 % 2;
40-
5 % 2;
41-
5 / 1 - 99;
42-
5000 * -100 * (1 + 2) * (5 * 6);
43-
1241 / 9 + 99;
44-
```
27+
```js
28+
4 + 10;
29+
1 * 3;
30+
12 * 4;
31+
4 % 2;
32+
5 % 2;
33+
5 / 1 - 99;
34+
5000 * -100 * (1 + 2) * (5 * 6);
35+
1241 / 9 + 99;
36+
```
4537

46-
1. Based on your work above, what does `%` do?
38+
**Notice how we want to end all of our expressions with semi-colons.**
4739

48-
1. Calculate your age in minutes using the console.
40+
1. Based on your work above, what does `%` do?
4941

50-
##### Bonus Section
42+
1. Calculate your age in minutes using the console.
5143

52-
1. The console is getting a little full. Use `clear()` to clean things up a little.
44+
1. The console is getting a little full. Use `clear()` or `⌘ K` to clean things up a little.
5345

5446
##### `string`s
5547

56-
1. In your console, put your name in a `string`!
48+
1. In your console, write your name as a `string`!
49+
50+
1. Use the `+` operator to _concatenate_ (join together) two or more
51+
`string`s, _e.g._:
52+
53+
```js
54+
// Your first and last names as an example
55+
"Lady " + "Gaga";
56+
```
57+
58+
- Your first and last names (as shown above in the example code snippet)
59+
- Your favourite singer's full name
60+
- Code Chrysalis
61+
62+
1. Try the following in your console, line by line. What happens? Fix the errors:
63+
64+
```js
65+
Where are the quotes?
66+
'hmm something is not right"
67+
'Do other ' * 'operators work with string concatenation?'
68+
```
69+
70+
#### Exploration
5771
58-
1. Use the `+` operator to _concatenate_ (join together) two or more
59-
`string`s, _e.g._:
72+
We want you to get comfortable with actively exploring through code. This often can mean using code that you don't know very much about yet. But don't worry! This is part of the process and you'll learn them in no time.
6073

61-
```js
62-
// Your first and last names as an example
63-
"Yan " + "Fan";
64-
```
74+
1. Answer the following questions by coding to test the questions:
6575

66-
- Your first and last names (as shown above in the example code snippet)
67-
- Your favourite singer's full name
68-
- Code Chrysalis
76+
1. What happens when I add a string and a number together?
77+
1. What if I reverse the order (e.g. number + string)?
78+
1. What happens if I multiply a number of `5` with a string `5`?
6979

70-
1. Try the following in your console, line by line. What happens? Fix the errors:
80+
1. Try the following line by line in your console. What do you think adding `.length` does? Try finding the length of other strings.
7181

72-
```js
73-
Where are the quotes?
74-
'hmm something is not right"
75-
'Do other ' * 'operators work with string concatenation?
76-
```
82+
```js
83+
"hello".length;
84+
"hello world".length;
85+
"123".length;
86+
```
7787

78-
1. We want you to get comfortable with actively exploring through code. Answer the following questions by coding to test the questions:
79-
1. What happens when I add a `string` and a `number` together?
80-
1. What if I reverse the order (e.g. `number` + `string`)?
81-
1. What happens if I multiply a `number` 5 with a `string` "5"?
88+
1. How about the below?
89+
```js
90+
"hello".toUpperCase();
91+
"HELLO".toLowerCase();
92+
"hello".endsWith("o");
93+
"hello".endsWith("e");
94+
"hello".endsWith("llo");
95+
"hello".endsWith();
96+
```
8297

98+
Can you think of more ways to test it?
99+
100+
`.toUpperCase()`, `.toLowerCase()`, and `.endsWith()` are what we call native methods. They are built-in to the JavaScript language and are available only for strings. We'll learn more about them later on.
101+
102+
1. Bonus question: Where can you find information about the methods used above?
103+
104+
## Homework
105+
106+
- Complete the exercises for this lesson.
107+
108+
# Foundations of Programming
109+
110+
## Objectives
111+
112+
- Understand what a program is
113+
- Understand why JavaScript is a useful programming language for beginners to learn
114+
- Describe and use JavaScript _expressions_
115+
- Describe and use arithmetic _operators_
116+
- Describe and use `number` and `string` data _types_

Diff for: intro-functions.md

-98
This file was deleted.

0 commit comments

Comments
 (0)