I have a type of object which I've declared like this:
function Stream(id, info, container){
var self = this;
this.id = id;
this.paddedId = ("00000" + this.id).substr(-5,5);
this.live = info['live'];
this.autoplay = info['autoplay'];
...
I instantiate that with:
var stream = new Stream(1, streamInfo, "stream");
On some occasions I instantiate several objects of that type at once. The object also has functions, I want to initiate it a bit cleaner, how can I do it like this, but keep my functions? See here:
var stream = new Stream({
'id': 1
'live': true
'autoplay': false
});
Or at least something similar to this.