undefined RangeError: Invalid array length RangeError: Invalid array length in cesium while drawing polygon

1. A concise explanation of the problem you’re experiencing.

undefined RangeError: Invalid array length RangeError: Invalid array length in cesium while drawing polygon.

i am passing array of coordinates to Cesium.Cartesian3.fromDegreesArray(a) where a is array of coordinates

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

var a==Zone[0].brmtPolygon;

//a.push(ncsZone[0].brmtPolygon);

alert(a.length)

//alert(coordinates);

//console.log(“new”+a);

ZoneDataSource.entities.add({

name : 'Red polygon on surface',

polygon : {

    hierarchy : Cesium.Cartesian3.fromDegreesArray(a),

    //material : Cesium.Color.RED

    extrudedHeight: 0,

    perPositionHeight : false,

    material : Cesium.Color.YELLOW.withAlpha(0.4),

    outline : true,

    outlineColor : Cesium.Color.BLACK

}

});

//viewer.flyTo(redPolygon);

viewer.dataSources.add(ZoneDataSource);

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

4. The Cesium version you’re using, your operating system and browser.