I have looked all over the shop and found various different ways of doing it but am having problems.
My emailed response
You can declare and instantiate objects in many ways but the most familiar might be like this:
this.bar = bar;
var myFoo = new foo('oh hi there');
Some things worth reading about:
That should be enough to get you started!