Find Bottom Left Tree Value LeetCode solution in JavaScript
1var findBottomLeftValue = function (root) {2let arr = [];3let q = [root];4while (q.length !== 0) {5let current = q.shift();6arr.push(current.val);7if (current.right) {8q.push(current.right);9}10if (current.left) {11q.push(current.left);12}13}14return arr[arr.length - 1];15};