Skip to content

Commit e076698

Browse files
Typo fixes in generics.md
Nothing crazy, just a bit of typo fixes here. Will try to keep the amount of commits of this type down in the future (more fixes per commit).
1 parent e3d26cc commit e076698

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/types/generics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ queue.push("1"); // ERROR : cannot push a string. Only numbers allowed
5353
// ^ if that error is fixed the rest would be fine too
5454
```
5555

56-
Of course this can quickly become painful e.g. if you want a string queue you have to go through all that effort again. What you really want is a way to say that whatever the type is of the stuff getting *pushed* it should be the same for whatever gets *poped*. This is done easily with a *generic* parameter (in this case on the class):
56+
Of course this can quickly become painful e.g. if you want a string queue you have to go through all that effort again. What you really want is a way to say that whatever the type is of the stuff getting *pushed* it should be the same for whatever gets *popped*. This is done easily with a *generic* parameter (in this case, at the class level):
5757

5858
```ts
5959
/** A class definition with a generic parameter */
@@ -172,9 +172,9 @@ declare function require(name: string): any;
172172
const something = require('something') as TypeOfSomething;
173173
```
174174

175-
This is just an example, if you are considering on using this `require` typings you don't need to cause:
175+
This is just an example; if you are considering on using this `require` typings, you don't need to because:
176176

177-
1. It's already there in `node.d.ts` you can install using `npm install @types/node --save-dev`.
177+
1. It's already there in `node.d.ts`: you can install using `npm install @types/node --save-dev`.
178178
1. You should consider using the type definitions for your library e.g. for jquery `npm install @types/jquery --save-dev` instead of using raw `require`.
179179

180180
### Design Pattern: Convenience generic

0 commit comments

Comments
 (0)