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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Richard Preske](https://secure.gravatar.com/avatar/bf0bdfba9a4ec594f8fda05134a38818?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Richard Preske
Courses Plus Student 4,356 PointsConverting a basic AJAX program
I'm trying to convert one of the projects in the basic AJAX course. I replaced the XHR requests with fetch and promise all and I get no errors. I'm having trouble, however, displaying the data - rooms full, empty and employees in, out. Any suggestions?
1 Answer
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsI see a few issues:
- the data items are arrays of objects, and don't have a "message" property (lines 13 & 14)
- the properties of an array ("for in") are just indexes use the values instead ("for of") (lines 36 & 58)
- the "name" is a property of the item ("property") and not the array ("data") (lines 42 & 64)
Richard Preske
Courses Plus Student 4,356 PointsRichard Preske
Courses Plus Student 4,356 PointsThanks, I'll check it out. The message property does work though displaying the array of objects when I logged to console - lines 13 and 14. Why?
Got it figured out, thanks again!
Steven Parker
230,688 PointsSteven Parker
230,688 PointsAttempting to get a 'message" attribute from an array should give you "undefined". If you see something else, what's the complete code in the callback at that point?