Get type of component

Is there any possibility to get comonent type? i mean, for example:

var grid = new dhtmlXGridObject(...);
// How to get, that "grid" variable is Grid component, not Toolbar or etc.

There is no standard API to get the type of component, you can use some kind of feature detection

if (grid.cells){ //grid } else if (grid.addButton){ //toolbar }