Suhan Gui Suhan Gui - 1 year ago 85
Javascript Question

Assigning numbers to a variable

I have 2 variables equal to 2 separate numbers. I want to assign those two numbers into the third variable.

The code should look something like this:

var x=1;
var y=2;
var cell=[];

return cell[x][y];
//I want the code to return cell[1][2]

Answer Source

If you want an array containing the two variables try

var cell = [x, y];
return cell;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download