function ListNode(val, next) { this.val = (val === undefined ? 0 : val) this.next = (next === undefined ? 0 : next) } var TEST = function () { function _getNum(node) { let str = ''; while (node !== 0) { str += node.val; node = node.next; } return parseInt(str) || 0; } return { exec: function (l1, l2) { return _getNum(l1) + _getNum(l2); } }; }();