[ readonly ] children

Class: ShapeContainer. Inherited from ContainerComponent.

Description:

Gets an array of child components.

A new array of child components is created each time .children is accessed, so you may not want to use it directly inside a for(let i=0; i < component.children.length, i++){} or while(...){} loops. First save it to a variable, then use it in such loop.

In loops for..in, for..of or component.children.forEach((c, i)=>{...}) it's accessed only once, so you are looping through the same array.

Type: Array.<Object>

Examples:

Looping through Window's components

// method 1
for(child of window.children)
{
    ...
}

// method 2
const _children = window.children;
for(let i = 0; i < _children.length; i++)
{
    const child = _children[i];
    ...
}

// method 3
window.children.each(child=>{
    ...
});