From existing art board , I am duplicating a image which is in path item, to a new document as below

rounded rectangular box is extracted to a new document.
now I need to resize art board , exact best fit of single image .
after that artboard should look like below

I am find difficulty in resizing artboard , 
as CarlosCanto suggested ,
| | var artboards=newDoc.artboards; |
| | var rect=artboards[0].artboardRect; |
| | |
| | $.writeln ("rect[0] :"+rect[0]+"rect[1] :"+rect[1]+"rect[2] :"+rect[2]+"rect[3] :"+rect[3]); |
| | rec[0]=newItem.position[0]; |
| | rec[3]=newItem.position[1]; |
| | rec[1]=newItem.width; |
| | rec[2]=newItem.height; |
| | app.redraw(); |
but artboard size is not changed, remained as its original size
in your sample, rect refers to a variable in memory, not to the actual artboardRect values
this sample resizes the artboard to the size of the selected object
var idoc = app.activeDocument;
var sel = idoc.selection[0];
var ab = idoc.artboards[0];
ab.artboardRect = sel.geometricBounds;