there is a little bit of hand-waving involved in calling JavaScript a functional language. JavaScript is not a side-effect free language, nor is it an expression-based language (i.e., it is not value-oriented, but rather variable-oriented). There is no tail call optimization in any of the current implementations, so recursion must be kept shallow. And the list goes on.
Truth be told, JavaScript is really one of the first hybrid imperative-functional languages.