Skip to content
Permalink
Browse files

get started: ch4/apB, adding cross-references of pillars

  • Loading branch information
getify committed Dec 10, 2019
1 parent 75dbec1 commit cfe5638bea4240b7ae6608ba21e86bb241dc4ab6
Showing with 15 additions and 15 deletions.
  1. +6 −6 get-started/apB.md
  2. +9 −9 get-started/ch4.md
@@ -9,7 +9,7 @@ In this appendix, we'll explore some exercises and their suggested solutions. Th

## Practicing Comparisons

Let's practice working with value types and comparisons where coercion will need to be involved.
Let's practice working with value types and comparisons (Chapter 4, Pillar 3) where coercion will need to be involved.

`scheduleMeeting(..)` should take a start time (in 24hr format as a string "hh:mm") and a meeting duration (number of minutes). It should return `true` if the meeting falls entirely within the work day (according to the times specified in `dayStart` and `dayEnd`); return `false` if the meeting violates the work day bounds.

@@ -34,7 +34,7 @@ Try to solve this yourself first. Consider the usage of equality and relational

## Practicing Closure

Now let's practice with closure.
Now let's practice with closure (Chapter 4, Pillar 1).

The `range(..)` function takes a number as its first argument, representing the first number in a desired range of numbers. The second argument is also a number representing the end of the desired range (inclusive). If the second argument is omitted, then another function should be returned that expects that argument.

@@ -63,7 +63,7 @@ Once you have code that works, *compare* your solution(s) to the code in "Sugges

## Practicing Prototypes

Let's work on `this` and objects linked via prototype.
Finally, let's work on `this` and objects linked via prototype (Chapter 4, Pillar 2).

Define a slot machine with 3 reels that can individually `spin()`, and then `display()` the current contents of all the reels.

@@ -138,7 +138,7 @@ Once you have code that works, *compare* your solution(s) to the code in "Sugges

Keep in mind that these suggested solutions are just that: suggestions. There's many different ways to solve these practice exercises. Compare your approach to what you see here, and consider the pros and cons of each.

Suggested solution for "Comparisons" practice:
Suggested solution for "Comparisons" (Pillar 3) practice:

```js
const dayStart = "07:30";
@@ -199,7 +199,7 @@ scheduleMeeting("17:30",30); // false
scheduleMeeting("18:00",15); // false
```

Suggested solution for "Closure" practice:
Suggested solution for "Closure" (Pillar 1) practice:

```js
function range(start,end) {
@@ -241,7 +241,7 @@ start3(0); // []
start4(6); // [4,5,6]
```

Suggested solution for "Prototypes" practice:
Suggested solution for "Prototypes" (Pillar 2) practice:

```js
function randMax(max) {
@@ -1,5 +1,5 @@
# You Don't Know JS Yet: Get Started - 2nd Edition
# Chapter 4: The Rest
# Chapter 4: The Bigger Picture

| NOTE: |
| :--- |
@@ -9,9 +9,9 @@ This book surveys what you need to be aware of as you *get started* with JS. The

The rest of the books in this series are where we will unpack all of the rest of the language, in far greater detail than we could have done in a few brief chapters here.

Remember to take your time, though. Rather than rushing onto the next book in an attempt to churn through all the books expediently, spend some time going back over the material in this book. Spend some more time looking through code in your current projects, and comparing what you see to what's been discussed here.
Remember to take your time, though. Rather than rushing onto the next book in an attempt to churn through all the books expediently, spend some time going back over the material in this book. Spend some more time looking through code in your current projects, and comparing what you see to what's been discussed so far.

When you're ready, this final chapter provides a brief preview and roadmap of what to expect from the rest of the book series, and how I suggest you proceed. Also, don't skip Appendix B, "Practice, Practice, Practice!"
When you're ready, this final chapter divides the organization of the JS language into three main pillars, then offers a brief roadmap of what to expect from the rest of the book series, and how I suggest you proceed. Also, don't skip the appendices, especially Appendix B, "Practice, Practice, Practice!".

## Pillar 1: Scope and Closure

@@ -83,17 +83,17 @@ But one of the most common questions I get is, "What order should I read the boo

My suggestion for most readers is, this how best to proceed through this series:

1. Get started on a solid foundation of JS with *Getting Started* (this book).
1. Get started on a solid foundation of JS with *Get Started* (Book 1) -- good news, you've almost finished this book already!

2. In *Scope & Closures*, learn the first pillar of JS: lexical scope, how that supports closure, and how the module pattern organizes code.
2. In *Scope & Closures* (Book 2), learn the first pillar of JS: lexical scope, how that supports closure, and how the module pattern organizes code.

3. In *Objects & Classes*, focus on the second pillar of JS: how JS's `this` works, how object prototypes support delegation, and how prototypes enable the `class` mechanism for OO-style code organization.
3. In *Objects & Classes* (Book 3), focus on the second pillar of JS: how JS's `this` works, how object prototypes support delegation, and how prototypes enable the `class` mechanism for OO-style code organization.

4. In *Types & Grammar*, tackle the third and final pillar of JS: types and type coercion, as well as how JS's syntax and grammar define how we write our code.
4. In *Types & Grammar* (Book 4), tackle the third and final pillar of JS: types and type coercion, as well as how JS's syntax and grammar define how we write our code.

5. With the **three pillars** solidly in place, *Sync & Async* then explores how we use flow control to model state change in our programs, both synchronously (right away) and asynchronously (over time).
5. With the **three pillars** solidly in place, *Sync & Async* (Book 5) then explores how we use flow control to model state change in our programs, both synchronously (right away) and asynchronously (over time).

6. The series concludes with *ES.Next & Beyond*, a forward look at the near- and mid-term future of JS, including a variety of features likely coming to your JS programs before too long.
6. The series concludes with *ES.Next & Beyond* (Book 6), a forward look at the near- and mid-term future of JS, including a variety of features likely coming to your JS programs before too long.

That's the intended order to read this book series.

0 comments on commit cfe5638

Please sign in to comment.
You can’t perform that action at this time.