Skip to content

Commit

Permalink
make the readme clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
veigaribo committed Oct 7, 2020
1 parent c3e0759 commit ce1d9cd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ a bit confusedly, classes are JS objects and instances are JS classes.

### Classes

A class is what defines the behavior that you want your other classes to
A class is what defines the behavior that you want your instances to
conform to.

For example, let's say that you want to define a class of things that can be
Expand Down Expand Up @@ -47,9 +47,10 @@ const addable = new Class({
})
```

But, as you might have seen, we also expect our instances to implement an `#equals` method.
But, as you might have seen, we also expect our instances to implement an
`#equals` method.

This could be another class:
That could be another class:

```javascript
const eq = new Class({
Expand All @@ -64,7 +65,7 @@ const eq = new Class({
```

And then the Addable class may _extend_ Eq, meaning that, in order to be an
instance of Addable, the class must also be an instance of Eq:
instance of Addable, the JS class must also be an instance of Eq:

```javascript
const addable = new Class({
Expand Down Expand Up @@ -98,8 +99,8 @@ class Number {
```

The only extra step is to define a static method called `generateData`, that
will take any number of random numbers as parameters and should return a
random JS instance of the JS class.
will take any number of random numbers in the range [0, 1] as parameters
and should return a random JS instance of the JS class.

```javascript
@instance(addable)
Expand Down

0 comments on commit ce1d9cd

Please sign in to comment.