Simple JavaScript iterative solution O(n), faster than 100% of solutions
\nvar kthSmallest = function(root, k) {\n    let stack = [];\n    let count = 0;\n    let node = root;\n    \n    while (true){\n        if (node){\n           
```\nvar kthSmallest = function(root, k) {\n    let stack = [];\n    let count = 0;\n    let node = root;\n    \n    while (true){\n        if (node){\n            stack.push(node);\n            node = node.left;\n        } else {\n            if (stack.length == 0) break;\n            node = stack.pop();\n            count += 1;\n            if (count == k) return node.val;\n            node = node.right;\n        }\n    }\n};\n```\n\nRelies on inorder traversal using a stack.
[]