Simple recursive JavaScript solution
\nvar preorderTraversal = function solution(root) {\n    if (!root) {\n        return [];\n    }\n    \n    return [root.val, ...solution(root.left), ...solutio
```\nvar preorderTraversal = function solution(root) {\n    if (!root) {\n        return [];\n    }\n    \n    return [root.val, ...solution(root.left), ...solution(root.right)];\n};\n```
['Recursion', 'JavaScript']