Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript AJAX Basics AJAX Concepts Create an XMLHttpRequest Object

Can I use let instead of var to declare a XMLHttpRequest object? The challenge doesn't accepts using let keyword

Hey everyone! I tried passing this challenge by doing this:

let request = new XMLHttpRequest();

But it didn't work until I changed let to var. Is there a reason for that?

thanks!

app.js
var request = new XMLHttpRequest(); // challange will not accept using 'let' do declare the variable

1 Answer

I downloaded the project files and some are dated Jun 9, 2014 so the challenge may predate the common use of let.