# Grouping objects

From JSXGraph Wiki

Jump to navigationJump to search## The underlying JavaScript code

```
var b1 = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-4, 3, 6, -3]});
var pArr = [];
pArr[0] = b1.create('point',[0,0], {size:4});
pArr[1] = b1.create('point',[2,1], {size:4});
pArr[2] = b1.create('point',[2,2], {size:4});
pArr[3] = b1.create('point',[0,1], {size:4});
var poly = b1.create('polygon',pArr);
```

The points are grouped together with the following command:

```
var gr = b1.create('group',pArr);
```