Working with Prototypes
So I wanted to write this down as it helps it to sink through the hard shell of my brain.
You can only add prototypes to constructor functions(or this is my current understanding).
This is an example from team tree house learning site that I have broken down to show you how its possible.
Here is an example constructor function.
Now we can add a prototype to that we can apply some functionality to.
Ok so that all really great but one thing I got a bit lost with was how do I then iterate over the object applying the prototype function to each one. Here is a example of how thats possible.
We have our questions object constructed in this example so if we pass this into another constructor function and create a new object with some added additions of keeping track of iterations.
Now this is where we can add in some prototypes and using the currentQuestionsIndex to keep track of our iterations over the questions.