I need to have an edge object like that :
var edge={ coordinates:[],  name};
function edge(coordinates,name)
{
this.coordinates = coordinates;
this.name = name;
}
However when I initialize it, I get an error saying edge is not a constructor.
var a=new Array();
a[0]=0+move; a[1]=200;  
a[2]=0+move; a[3]=130;
var ed=new edge(a,"a");

edge. If you want a constructor, get rid of the object.function edge...notvar edge = {...objectandfunction, try changing name and it will work.