I want to create some objects but don't know how to write the arguments of a function inside another function. Here is code with comments to explain better.
function Troop(rss, time, offense, defense){
this.rss= rss;
this.time= time;
this.offense= offense;
this.defense= function types(a, b, c, d){
this.a= a;
this.b= b;
this.c= c;
this.d= d;
}
}
Dwarf = new Troop(1,2,3, new types(11,22,33,44)); // this most be wrong
alert(Dwarf.defense.a) // how can I access to the values after?
Thanks.