add transcript for hr 1 min 7 - 8 with illustrative screenshots
This commit is contained in:
@@ -14,7 +14,7 @@ computer-generated subtitles.
|
|||||||
+ (100% Optional) ***enhance*** the content with hyperlinks on specific terms
|
+ (100% Optional) ***enhance*** the content with hyperlinks on specific terms
|
||||||
so people don't have to google for ages to understand things.
|
so people don't have to google for ages to understand things.
|
||||||
|
|
||||||
This is `elm`. I'm Richard Feldman @rtfeldman
|
This is `elm`. I'm Richard Feldman [@rtfeldman](https://github.com/rtfeldman)
|
||||||
|
|
||||||
So we're going to start with just the absolute basics,
|
So we're going to start with just the absolute basics,
|
||||||
just **Rendering a Page**. but before we can do that,
|
just **Rendering a Page**. but before we can do that,
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
`Day 1 Hour 1 - h1.mp4 @ 05:11`
|
`Day 1 Hour 1 - h1.mp4 @ 05:11`
|
||||||
Now the _relevant_ part is that
|
Now the _relevant_ part is that
|
||||||
this entire chunk of code is an expression
|
this entire chunk of code is an expression;
|
||||||
it evaluates to a single value which means it's "_portable_"
|
it evaluates to a single value which means it's "_portable_".
|
||||||
you can pick it up and just drop it somewhere else
|
You can pick it up and just drop it somewhere else
|
||||||
and just say "`foo` equals `if quantity == 1 then singular else plural`..."
|
and just say "`foo` equals `if quantity == 1 then singular else plural`..."
|
||||||
you can do that anywhere you would have any single value
|
You can do that anywhere you would have any single value.
|
||||||
you can just drop in this entire `if` expression
|
You can just drop in this entire `if` expression,
|
||||||
perhaps with parentheses around it to disambiguate.
|
perhaps with parentheses around it to disambiguate.
|
||||||
And it's exactly the same thing with the ternary
|
And it's exactly the same thing with the ternary
|
||||||
and so you need this both `if` and `else`
|
and so you need this both `if` and `else`
|
||||||
@@ -82,7 +82,18 @@ But let's say we make a _mistake_ in our implementation here:
|
|||||||
|
|
||||||
So we're like:
|
So we're like:
|
||||||
`pluralize "leaf" "leaves" 1`
|
`pluralize "leaf" "leaves" 1`
|
||||||
|
|
||||||

|

|
||||||
|
and it gives us "leaf" down here (_refering to the `console.log` output at the bottom of the Babel page_)
|
||||||
|
|
||||||
and it gives us "leaf" down here
|
If we call `pluralize` passing `"leaf"` `"leaves"` and `3`
|
||||||
|

|
||||||
|
It gives us "leaves".
|
||||||
|
Great! that's what we _expect_!
|
||||||
|
Any number over 1 should give us the `plural` form.
|
||||||
|
|
||||||
|
And then let's say,
|
||||||
|
when we implemented this we _accidentally_ made a typo here:
|
||||||
|
|
||||||
|
Instead of `singular` we said `singula` ...
|
||||||
|
|
||||||
|
Ok, so, as we can see, this code _still works_!
|
||||||
|
|||||||
Reference in New Issue
Block a user