When I use jquery library I notice that the code will continue execution regardless the previous line complete the execution. More precisely while using jquery ajax, it will continue execution without waiting for the ajax result. Is this because javascript takes advantage of parallel processing? Or to which category this can be referred to. Also can we call javascript as a functional programming language.? It will be greatly appreciated if someone could explain this briefly. Thanks in advance.

2 Answers 2


Here is the deal.

1) You can use JavaScript as a functional language. I do so every day! its a great way to write code in JavaScript. The array operations in recent versions of JavaScript and the fact that the JavaScript function has all the power of a lambda in other languages make this easy to do. I would not call JavaScript a functional language but would call it a multi para-dime language.

2) There is only one thread of operation in JavaScript, however many things including Ajax operate in an Asynchronous manor. So when you make an Ajax call it returns right away and when server returns a value it sends an event that contains the return value.

3) JavaScript also lets you plan events for some time in the future. So you can tell it "In 500ms run this function"

There is a chapter on functional javascript in Programming HTML5 Applications this will be out in August. There should be a preview version of the book out sooner.

  • Book looks interesting, I've preordered it on Amazon. Where do I get the preview? It's not that I'm impatient, but I want everything NOW!! ;)
    – Ian
    Commented Apr 17, 2011 at 9:49

No, ajax does not make use of parallel processing.

The A in ajax stands for asynchronous. This means that it sends off a request to the server, and then continues on processing the next statement. When the ajax data is ready, that code executes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.