JS Recursive solution with comments
\nvar isBalanced = function(root) {\n    //handle case when root itself is null\n\tif(root === null) return true;\n\t//turns to false if unbalanced tree encount
```\nvar isBalanced = function(root) {\n    //handle case when root itself is null\n\tif(root === null) return true;\n\t//turns to false if unbalanced tree encountered\n    let flag = true;\n\t//recursive function - it recursively returns the height of the tree \n    function helper(root) {\n\t    //base case of recursion - tree with no nodes return height 0\n        if(root.left === null && root.right === null) {\n            return 0\n        }\n        let leftHeight = 0, rightHeight = 0;\n        if(root.left !== null) {\n\t\t    //height of left subtree is one plus the height of child sub tree\n            leftHeight = 1 + helper(root.left);\n        }\n        if(root.right !== null) {\n\t\t   //height of right subtree is one plus the height of child sub tree\n            rightHeight = 1 + helper(root.right);   \n        }\n\t\t//height of tree is max between height of left and right subtree\n        let actualHeight = Math.max(leftHeight, rightHeight);\n\t\t//if abs diff between leftHt and right Ht greater than one; turn flag to false\n        if(Math.abs(leftHeight-rightHeight) > 1) flag = false;\n        return actualHeight;\n    }\n    helper(root);\n    return flag\n};\n```
['JavaScript']