Intuitive JavaScript Solution
\n/**\n * @param {TreeNode} root\n * @param {number} L\n * @param {number} R\n * @return {number}\n */\nvar rangeSumBST = function(root, L, R) {\n    // check i
```\n/**\n * @param {TreeNode} root\n * @param {number} L\n * @param {number} R\n * @return {number}\n */\nvar rangeSumBST = function(root, L, R) {\n    // check if value is in the given range\n    const isInBetween = val => val >= L && val <= R;\n    // sum the value if it\'s in the range\n    const add = (val, sum) => isInBetween(val) ? sum += val : sum;\n\t// traverse through the nodes and sum the values in range\n    const preorder =(root, sum) => {\n        if (!root) return sum;\n        return add(root.val, sum) + preorder(root.left, sum) + preorder(root.right, sum);\n    } \n    return preorder(root, 0)\n};\n```
['Recursion', 'JavaScript']