@@ -212,7 +212,7 @@ const Page = () => (
212212 />
213213 < P >
214214 As you can see, when you check/uncheck a checkbox, it updates the
215- underlying data (the < Code > done</ Code > property), and in turn the
215+ underlying data (the < Code > done</ Code > property), and in turn, the
216216 UI gets updated. This is how UI libraries like React and Vue work.
217217 </ P >
218218 < EmojiSeparator
@@ -226,7 +226,7 @@ const Page = () => (
226226 description = {
227227 < >
228228 When the user interacts with the UI, the data gets updated,
229- and in turn the UI gets updated
229+ and in turn, the UI gets updated
230230 </ >
231231 }
232232 />
@@ -356,7 +356,7 @@ const Page = () => (
356356 < strong > Now, here’s a question:</ strong > { ' ' }
357357 < Highlight > How can we prevent mistakes like this?</ Highlight > { ' ' }
358358 Little Duckling is a junior developer, but we want to make sure
359- that he succeeds at his job by helping him make less mistakes.
359+ that he succeeds at his job by helping him make fewer mistakes.
360360 </ P >
361361 < EmojiSeparator
362362 emojis = { [ 'sweat' , 'chickEgg' , 'sweat' ] }
@@ -797,7 +797,7 @@ const Page = () => (
797797 />
798798 < P >
799799 Yes! In TypeScript, you can use keywords like{ ' ' }
800- < Code > Readonly<...></ Code > to conovert one type into another
800+ < Code > Readonly<...></ Code > to convert one type into another
801801 type—in this case, it creates a new type with{ ' ' }
802802 < Code > readonly</ Code > properties.
803803 </ P >
@@ -827,7 +827,7 @@ const Page = () => (
827827 < P >
828828 < strong >
829829 1. We can define a < Code > type</ Code > to make sure that the input
830- and the output of a function is of the correct type.
830+ and the output of a function are of the correct type.
831831 </ strong >
832832 </ P >
833833 < CodeBlock
@@ -841,7 +841,7 @@ const Page = () => (
841841 < P >
842842 < strong >
843843 2. We can use the < Code > readonly</ Code > keyword to make sure
844- that an object property is not modified.
844+ that an object’s properties are not modified.
845845 </ strong >
846846 </ P >
847847 < CodeBlock
@@ -979,13 +979,25 @@ const Page = () => (
979979 />
980980 < P >
981981 < strong > Third,</ strong > we want to make sure that{ ' ' }
982- < Code > completeAll() </ Code > returns a new array and does NOT modify
983- the original array. Each item in the array is already { ' ' }
984- < Code > readonly </ Code > , but < em > the array itself </ em > is NOT { ' ' }
985- < Code > readonly </ Code > yet.
982+ < Highlight >
983+ < Code > completeAll() </ Code > returns a new array and does NOT
984+ modify the original array.
985+ </ Highlight >
986986 </ P >
987+ < CodeBlock
988+ snippet = { snippets . kuzw }
989+ shouldHighlight = { lineIndex => lineIndex === 1 }
990+ />
987991 < P >
988- To make the array itself < Code > readonly</ Code > ,{ ' ' }
992+ Because we defined < Code > Todo</ Code > earlier using{ ' ' }
993+ < Code > Readonly<...></ Code > , each todo item in the array is
994+ already < Code > readonly</ Code > . However, < em > the array itself</ em > { ' ' }
995+ is NOT < Code > readonly</ Code > yet.
996+ </ P >
997+ < P >
998+ < strong >
999+ To make the array itself < Code > readonly</ Code > ,
1000+ </ strong > { ' ' }
9891001 < Highlight >
9901002 we’ll add the < Code > readonly</ Code > keyword to{ ' ' }
9911003 < Code > Todo[]</ Code > like so:
@@ -1017,7 +1029,8 @@ const Page = () => (
10171029 Yes, Little Duckling! We use the < Code > readonly</ Code > keyword for
10181030 arrays. And by doing so,{ ' ' }
10191031 < Highlight >
1020- TypeScript will prevent you from accidently modifying the array.
1032+ TypeScript will prevent you from accidentally modifying the
1033+ array.
10211034 </ Highlight >
10221035 </ P >
10231036 < CodeBlock
0 commit comments