expandTree format issue

I’m trying to use expandTree to expand tree
However, I’m getting an unexpected number error.

go.GraphObject.make(go.Node, "Auto",
   { 	expandTree(2),
   isTreeExpanded: false,
       },

Looked over the docs here, Node | GoJS API, but it wasn’t clear to me what the format should be.

tried putting it outside the {} but that created other errors. not a function, not defined etc.

I hope you realize that go.GraphObject.make is used to build the visual tree of a Part (a Node in this case). It does not make sense to try to call Node.expandTree when building a Node, especially since you are not even calling that method on the Node being built. Unless you have defined your own expandTree function, that should cause a JavaScript error.

Setting Node.isTreeExpanded to true or false is what you need to do to make sure it is expanded or collapsed when the node is created.