text: /**
  Given a binary tree, return the inorder traversal of its nodes' values.
  
  For example:
  Given binary tree {1,#,2,3},
     1
      \
       2
      /
     3
  return [1,3,2].
  
  Note: Recursive solution is trivial, could you do it iteratively?
  
   * Definition for binary tree
   * function TreeNode(val) {
   *     this.val = val;
   *     this.left = this.right = null;
   * }
   */
  
  /**
   * @param {TreeNode} root
   * @returns {number[]}
   */
  var inorderTraversal = function(root) {
      var stack = [],
          result = [],
          cur;
      cur = root;
      while (stack.length > 0 || cur !== null) {
          if (cur !== null) {
              stack.push(cur);
              cur = cur.left;
          } else {
              cur = stack.pop();
              result.push(cur.val);
              cur = cur.right;
          }
      }
      return result;
  };
  