[JavaScript] Simple iterative solution
\nvar preorderTraversal = function(root) {\n  const result = [];\n  const stack = [];\n  let node = root;\n  \n  while (node) {\n    node.val && result.push(nod
```\nvar preorderTraversal = function(root) {\n  const result = [];\n  const stack = [];\n  let node = root;\n  \n  while (node) {\n    node.val && result.push(node.val);  \n    node.right && stack.push(node.right);      \n    node = node.left || stack.pop(); \n  }\n  \n  return result;\n};\n```
[]