diff --git a/1-slides.html b/1-slides.html
index 156e360..cabd775 100644
--- a/1-slides.html
+++ b/1-slides.html
@@ -10,10 +10,6 @@
-
-
-
-
@@ -187,9 +183,9 @@
--
+ - **The browser's JS `console`**
- Local text file in editor, e.g. TextEdit, [VS Code](https://code.visualstudio.com/)
- Online playground e.g. [CodePen](https://codepen.io), [CodeSandbox](https://codesandbox.io)
- - **The browser's JS `console`**
@@ -240,25 +236,33 @@
--
- ### `document`
+ ```js
+ document
+ ```
the entire HTML document
--
- ### `document.title`
+ ```js
+ document.title
+ ```
the page (document) title
--
- ### `document.body`
+ ```js
+ document.body
+ ```
the body element
--
- ### `document.body.children`
+ ```js
+ document.body.children
+ ```
all the elements within the body
@@ -266,39 +270,45 @@
--
- #### `document.getElementById("board")`
+ ```js
+ document.getElementById("board")
+ ```
- document.querySelector("#board")
+ document.querySelector("#board")
the (first) element with id="board"
--
- #### `document.getElementsByTagName("h1")`
+ ```js
+ document.getElementsByTagName("h1")
+ ```
- document.querySelectorAll("h1")
+ document.querySelectorAll("h1")
all the h1 elements
--
- #### `document.getElementsByClassName("player")`
+ ```js
+ document.getElementsByClassName("player")
+ ```
- document.querySelectorAll(".player" )
+ document.querySelectorAll(".player")
all the elements with class="player"
--
- document.getElementsByClassName("player").length
+ document.getElementsByClassName("player").length
- document.querySelectorAll(".player").length
+ document.querySelectorAll(".player").length
the number of elements with class="player"
--
- document.getElementById("p1-name").textContent
+ document.getElementById("p1-name").textContent
the text inside the element with id="p1-name"
@@ -335,21 +345,23 @@ document.querySelectorAll(".player").lengthchange the page title
note the double-quotes
--
- document.getElementById("p1-name").textContent = "Sofia"
+ document.getElementById("p1-name").textContent = "Sofia"
replace the text of the #p1-name element
--
- document.getElementById("p1-name").append(" & friends")
+ document.getElementById("p1-name").append(" & friends")
add to the end of the element's current text
@@ -429,8 +441,14 @@ document.querySelectorAll(".player").length document.querySelectorAll(".player").lengthcharacters
Variables let us **remember** values
- ```
+ ```js
let remember = "Sept. 21";
```
@@ -820,7 +838,7 @@ characters
- ```
+ ```js
let bankruptcy;
```
@@ -830,7 +848,7 @@ characters
### Assigning a variable
- ```
+ ```js
let myDeclaredVariable;
myDeclaredVariable = "so value, much wow";
```
@@ -839,7 +857,7 @@ characters
### Declaring & assigning at once
- ```
+ ```js
let myAssignedVariable = "such efficient, amaze";
```
@@ -851,7 +869,7 @@ characters
aka a variable that can't be changed
- ```
+ ```js
const myUnchangeableVariable = "Never gonna give you up";
```
@@ -914,7 +932,7 @@ characters
What happens when this code runs?
- ```
+ ```js
let answerToLife = ((4 + 1) * 2 * 4) + 2;
```
@@ -994,7 +1012,7 @@ characters
Arrays let us keep multiple values together in a single collection
- ```
+ ```js
let synonyms = ["plethora", "array", "cornucopia"];
```
@@ -1060,11 +1078,15 @@ characters
What do you think each of these does? (Try it!)
- `["c", "a", "d", "b"].sort()`
+ ```js
+ ["c", "a", "d", "b"].sort()
+ ```
- ["lions", "tigers", "bears oh my!"].join(" & ")
+ ["lions", "tigers", "bears oh my!"].join(" & ")
- `[1, 2, 3].concat([4, 5, 6])`
+ ```js
+ [1, 2, 3].concat([4, 5, 6])
+ ```
--
@@ -1090,11 +1112,13 @@ characters
```js
let abcArray = ["a", "b", "c"];
abcArray[1] = "d";
+ abcArray;
```
```js
let abcString = "abc";
abcString[1] = "d";
+ abcString;
```
--
@@ -1112,11 +1136,13 @@ characters
```js
let numbers1 = [1, 2, 3];
let result1 = numbers1.push(4);
+ numbers1;
```
```js
let numbers2 = [1, 2, 3];
let result2 = numbers2.concat([4]);
+ numbers2;
```
--
@@ -1143,7 +1169,7 @@ characters
```js
const constVariable = "original value";
constVariable = "new Value";
-
+ ```
--
@@ -1200,17 +1226,27 @@ characters
### Getting property values
- `js.name`
+ ```js
+ js.name
+ ```
+
+
+ ```js
+ js.isAwesome
+ ```
- `js.isAwesome`
--
### Using property values
- `js.name.startsWith("Java")`
+ ```js
+ js.name.startsWith("Java")
+ ```
- `let age = 2022 - js.birthYear;`
+ ```js
+ let age = 2022 - js.birthYear;
+ ```
--
@@ -1225,7 +1261,7 @@ characters
indecisive.snack = "chips";
```
- ---
+ --
### Exercise
@@ -1244,7 +1280,7 @@ characters
};
```
- ---
+ --
### Nested objects
@@ -1359,6 +1395,7 @@ characters
console.log(hello.length);
const yello = hello.toUpperCase();
```
+
[✨MDN✨ JS > Standard built-in objects > String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
--
@@ -1420,14 +1457,7 @@ characters
plugins: [ RevealMarkdown, RevealHighlight, RevealNotes, CopyCode ]
});
-
-
- // // Set selector for Klipse interactive snippets
- // window.klipse_settings = {
- // selector_eval_js: '.eval-js', // css selector for the html elements you want to klipsify
- // };
-