LeetCode #104 - Maximum Depth of Binary Tree (JavaScript)

Well, recursion.

const maxDepth = root => {
    return !root ? 0 : Math.max(maxDepth(root.left), maxDepth(root.right)) + 1;
}