JavaScript recursive DFS with clearly written comments
javascript\n/**\n * Definition for a binary tree node.\n * function TreeNode(val) {\n *     this.val = val;\n *     this.left = this.right = null;\n * }\n */\n/
```javascript\n/**\n * Definition for a binary tree node.\n * function TreeNode(val) {\n *     this.val = val;\n *     this.left = this.right = null;\n * }\n */\n/**\n * @param {TreeNode} root\n * @param {number} val\n * @return {TreeNode}\n */\nvar searchBST = function(root, val) {\n  return dfs(root);\n\n  function dfs(node) {\n\tif (node == null) { /* our base case which we will reach at leaf nodes */\n      return null; /* the path just traversed doesn\'t contain the target so we return null */\n    } else {\n      if (node.val === val) {\n        return node; /* exact match to our target val, return the subtree rooted at the current node */\n      }\n      /* target not yet found, compare node.val to target and traverse the left/right subtrees accordingly */\n      if (node.val > val) {\n        return dfs(node.left);\n      }\n      if (node.val < val) {\n        return dfs(node.right);\n      }\n    }\n  }\n};\n```
['Depth-First Search', 'Recursion', 'JavaScript']