Passing an array to an object as an argument
<p>I'm new to javascript and probably trying to do something stupid since an hour of googling didn't result in any examples.</p>

<p>I'm trying to learn objects so I made a constructor function like this:</p>

<pre><code>//generic object
function clip(name, xposition, firstVisibleFrame, lastVisibleFrame, playStart, playEnd, defaultFrame, seqLoopStart, seqLoopEnd, backStateLevel){
this.name = name;
this.xposition = xposition;
this.outlinesArray =[];
this.firstVisibleFrame = firstVisibleFrame;
this.lastVisibleFrame = lastVisibleFrame;
this.outlinePath = ("outlines/" +this.name +"_");
this.playStart = playStart;
this.playEnd = playEnd;
this.defaultFrame = defaultFrame;
this.seqLoopStart = seqLoopStart;
this.seqLoopEnd = seqLoopEnd;
this.backStateLevel = backStateLevel;
};
</code></pre>

<p>Next I will create a new instance of that object with something like:</p>

<pre><code>livingroomTable = new clip("livingroomTable");
</code></pre>

<p>...but now I'm really stuck because the next parameter I should pass to the function is actually a huge array with hundreds of values..</p>

<p>I tried to put the array inside the argument like this:</p>

<pre><code> livingroomTable = new clip("livingroomTable", [value1, value2, value3, value4, value5 and so on and so on]);
</code></pre>

<p>but this gives me a syntax error.</p>

<p>I don't want to make this array a global variable either. What is the correct syntax of passing an array of values as a part of the function call's arguments?</p>

<p>EDIT:</p>

<p>Here is the actual code:</p>

<pre><code>//generic object
function clip(name, xposition, firstVisibleFrame, lastVisibleFrame, playStart, playEnd, defaultFrame, seqLoopStart, seqLoopEnd, backStateLevel){
this.name = name; //objektin nimi tulee funktion kutsusta
this.xposition = xposition;
this.outlinesArray =[];
this.firstVisibleFrame = firstVisibleFrame;
this.lastVisibleFrame = lastVisibleFrame;
this.outlinePath = ("outlines/" +this.name +"_");
this.playStart = playStart;
this.playEnd = playEnd;
this.defaultFrame = defaultFrame;
this.seqLoopStart = seqLoopStart;
this.seqLoopEnd = seqLoopEnd;
this.backStateLevel = backStateLevel;
};


livingroomTable = new clip(
"livingroomTable", //name

["1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1220.69","1216.69","1207.69","1194.69","1167.69","1157.01","1147.24","1137.62","1127.74","1118.55","1109.88","1100.17","1090.51","1080.69","1070.28","1059.5","1048.87","1038.21","1027.6","1017.31","1007.31","997.208","987.153","977.152","967.848","959.258","950.808","942.887","935.103","927.326","919.256","910.834","902.452","894.231","886.561","879.269","872.072","865.057","858.292","851.484","844.527","837.655","830.747","823.629","815.898","807.221","798.142","789.152","780.341","771.358","762.248","753.089","743.97","734.954","726.148","717.699","709.299","700.826","692.102","682.849","673.258","663.37","653.188","642.48","631.498","620.551","609.866","599.544","589.439","579.088","568.508","557.794","547.028","536.037","524.912","514.043","502.899","491.412","480.102","469.097","457.844","446.368","434.919","423.84","412.74","401.657","390.55","379.284","368.162","357.316","346.606","335.973","325.144","314.01","302.658","291.207","279.392","267.133","254.62","241.775","229.179","216.763","204.423","192.239","180.41","168.484","155.502","141.701","127.828","114.008","100.403","87.0368","73.5946","59.7342","45.3524","31.0484","16.8761","helmi.96","-11.522","-25.6947","-39.5332","-53.1723","-66.7146","-80.253","-93.1294","-106.086","-119.531","-133.534","-148.801","-165.444","-183.67","-202.813","-222.634","-242.769","-263.074","-283.495","-303.787","-322.998","-341.376","-359.338","-377.081","-395.064","-413.628","-432.233","-451.409","-472.675","-493.827","-515.078","-537.029","-558.747","-583.8","-610.595","-645.864","-695.789","-711.965","-737.979","-752.979","-836.048","-862.75","-864.75","-884.835","-911.473","-927.473","-969.103","-1030.36","-1002.83","-1036.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08","-1048.08"];, //xposition

352, //firstVisibleFrame

545, //lastVisibleFrame

2058, //playStart

2304, //playEnd

2175, //defaultFrame

-1000, //seqLoopStart

-1000, //seqLoopEnd

1 //backStateLevel

);
</code></pre>

<p>Hmmmm actually I think my problem is the semicolon at the end of array right? :D</p>
