So far we have been dealing with Pure languages, no modification possible.
We will use a program to count, in Java:

Where using classes is important, as we can create multiple independent instances of this.
We want to recreate this functionality in Paret, but adding the least functionality possible. Hence, we will avoid using classes, as adding this will make our language too complex (we’ll do that later in the course).
We can implement this by using functions. Functions encapsulate State:

Problems with our function “objects”:
Going back to the JavaScript snippet:

We can use it like:

Can we mimic classes, i.e., create independent classes?

Yes we can!
Now that we have the desired code written in JavaScript, let’s convert it into Paret!