132ms in JavaScript
var preorderTraversal = function(root) {\n      if (!root) return [];\n      var result = [];\n      var stack = [root];\n      \n      while(stack.length) {\n 
    var preorderTraversal = function(root) {\n      if (!root) return [];\n      var result = [];\n      var stack = [root];\n      \n      while(stack.length) {\n        var node = stack.pop();\n        result.push(node.val);\n        if (node.right) stack.push(node.right);\n        if (node.left) stack.push(node.left);\n      }\n      return result;\n    };
['JavaScript']