@Yogendra – there is no Polygon with only two path points.
Two path points make a GraphicLine object.
So you could construct it this way:
var pathPoints = [["0","10"],["100","110"]];
var gL1 = app.documents[0].graphicLines.add({ strokeColor:"Magenta", strokeWeight:10 //… add some more properties });
gL1.paths[0].entirePath = pathPoints;
Uwe