I was implementing a routing algorithm in javascript, but when I assign a negative one variable in the array gives me this error: invalid array length.
var node = new Array()
node[0] = new Array(6,7)
node[1] = new Array(5,-4,8)
node[2] = new Array(-2) //Here, invalid array length
I do not know how to resolve this error.