javascript clean solution
\nvar zigzagLevelOrder = function(root) {\n    let res = [];\n    helper(root, 0, res);\n    return res;\n};\n\nvar helper = function(node, level, res){\n    if
```\nvar zigzagLevelOrder = function(root) {\n    let res = [];\n    helper(root, 0, res);\n    return res;\n};\n\nvar helper = function(node, level, res){\n    if(!node) return;\n    if(!res[level]) res[level] = [];\n    level % 2 ? res[level].unshift(node.val) : res[level].push(node.val);\n    helper(node.left, level + 1, res);\n    helper(node.right, level + 1, res);\n}\n```
[]