JS Recursive, Iterative Inorder Solutions
Recursive\n\nconst kthSmallest = (root, k) => {\n  let n = 0;\n  let res;\n  const inorder = (root) => {\n    if (!root) return;\n    inorder(root.left);\n    i
Recursive\n```\nconst kthSmallest = (root, k) => {\n  let n = 0;\n  let res;\n  const inorder = (root) => {\n    if (!root) return;\n    inorder(root.left);\n    if (n++ < k) res = root.val;\n    inorder(root.right);\n  };\n  inorder(root);\n  return res;\n};\n```\n\nIterative\n```\nvar kthSmallest = function (root, k) {\n  const stack = [];\n  let count = 1;\n  let node = root;\n\n  while (node || stack.length) {\n    while (node) {\n      stack.push(node);\n      node = node.left;\n    }\n    node = stack.pop();\n    if (count === k) return node.val;\n    else count++;\n    node = node.right;\n  }\n};\n```
['JavaScript']