[JavaScript] Concise solution
Facts,\n1. The root is at the end of postorder\n2.  inorder is of the form [...leftinorder, root, ...rightinorder]\n3.  postorder is of the form [...leftpostord
Facts,\n1. The `root` is at the end of `postorder`\n2.  `inorder` is of the form `[...leftinorder, root, ...rightinorder]`\n3.  `postorder` is of the form `[...leftpostorder, ...rightpostorder, root]`\n4.  `leftinorder.length === leftpostorder.length`\n5.  `rightinorder.length === rightpostorder.length`\n\nSolution,\n```\nvar buildTree = function(inorder, postorder) {\n    if (inorder.length === 0) return null;\n\n    let root = postorder[postorder.length - 1];\n    let pivot = inorder.indexOf(root);\n\n    return {\n        val: root,\n        left: buildTree(inorder.slice(0, pivot), postorder.slice(0, pivot)),\n        right: buildTree(inorder.slice(pivot + 1), postorder.slice(pivot, -1))\n    };\n};\n```
['Recursion', 'JavaScript']