Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Asynchronous Programming with JavaScript What is Asynchronous Programming? Examples of Synchronous and Asynchronous Code

Help: I didn't saw a change made to the asynchronous code in the second example. Additionally I cant unzip the workfile

... Because there is one file with a question mark in it. But that's only a minor problem.

Elisa Burghard
Elisa Burghard
9,276 Points

changes I saw:

  • line 3(synchronous) to line 4(asynchronous) xhr.open('GET', url) // omitted 'false'
  • line 10(synchronous) to line 11(asynchronous) xhr.send() // omitted 'null'

Hope this helps and happy coding!

1 Answer

Hi, The 3rd arg in the open() method was updated from false to true. Originally it was set as false. Guil simply removed the 3rd arg since it's optional. If the 3rd arg isn't explicitly set JavaScript uses true as its default value. You can explicitly set it to true if you'd like but it's not necessary.

open(method, url, async)

More Info https://www.w3schools.com/js/js_ajax_http_send.asp