Simple JavaScript solution with recursion
\nvar postorder = function(root, res = []) {\n  if (root === null) {\n    return res;\n  }\n\n  for (let i = 0; i < root.children.length; i++) {\n    postorder(
```\nvar postorder = function(root, res = []) {\n  if (root === null) {\n    return res;\n  }\n\n  for (let i = 0; i < root.children.length; i++) {\n    postorder(root.children[i], res);\n  }\n\n  res.push(root.val);\n  return res;\n};\n```
['JavaScript']