console.log('Please notice that you have just defined the column "'+col.name+'". In order to access it, you need to use "table.getColumn(\''+col.name+'\');"!');
}
this.columns.push(col);
this[col.name]=col;
this[col.name]=this[col.name]||col;
returnthis;
};
Table.prototype.hasColumn=function(col){
col=this.createColumn(col);
varcols=this.columns.filter(function(column){
returncolumn.name===col.name;
});
returncols.length>0;
};
Table.prototype.getColumn=function(colName){
varcol=this[colName];
if(!col){
varcol=this.createColumn(colName);
if(!this.hasColumn(col)){
thrownewError('Table '+this._name+' does not have a column named '+colName);