Get all child not working?

For some reasons I can’t get this to work properly… can someone explain to me why it isn’t working, in JS?
function Start()

    for (var child : Transform in transform)
        child.rigidbody.isKinematic = true;
        child.collider.enabled = false;


That’s probably because your code only lists direct children, not children of children.

You may want to use GetComponentsInChildren(Rigidbody) get get all Rigidbody components in any of the childs