Hi,

I'm trying to do an array of objects in javascript and also I want to know how to get away an object if it doesn't exist anymore. My code is:

Code:
var objects = new Array();

function obj(id){

	this.id=id;
	this.size=size; 
	
}
function CreateArray(id_object)
{

var i;
w=w+1;

objects[w] = new obj();

for(i=0;i<=w;i++)
{
if(id_object==null)
	{
	objects[i] = [].concat(objects.slice(0,i),objects.slice(-i-1));
	
	}
	
}
	}
I know something is wrong with the second function but I don't know what!

Thank you so much in advance!