var entity = new IgeEntity(); entity.addGroup('g1', 'g2'); // This will output "2" console.log(entity.groupCount());